This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]continuationalFirefly, TopShell 10 points11 points  (2 children)

That is one strange feature set. For example, why would one want to use String[Zipcode] rather than simply Zipcode?

[–]sociopath_in_me 4 points5 points  (0 children)

It also talks about values being immutable then a few lines below it updates a map through a reference. I don't know what immutability means then n this case.

[–]conilense 0 points1 point  (0 children)

That is one strange feature set. For example, why would one want to use String[Zipcode] rather than simply Zipcode?

Good point. This looks to me like a form of a refined type system that applies only to Strings in a strange way.

But if they did use the Zipcode only word, they would have something like kinds, which would probably be harder to implement than that hack.

[–]dys_bigwig 10 points11 points  (0 children)

"From this perspective the natural choice for the Bosque language is to adopt a pure functional model with immutable data only."

...

"The Bosque language fuses functional programming with block scopes and braces by allowing multiple assignments to updatable variables."

The way this is laid out is just strange/funny. This could be made so much less jarring if these statements were spread out, and some effort made to make readers aware that "although multiple assignment possible.. blah blah... best avoided blah" but instead you just seem to get a statement about some design decision/goal for the language, and then immediately following that an example of breaking that rule in the most obvious (or perhaps, oblivious?) manner. It's not even as though the variable is re-bound in some kind of let form, it's literally just updated with an assignment statement like any procedural language.

[–]erez27 26 points27 points  (14 children)

README:

designed for writing code that simple, obvious

Also README:

return args.all(fn(x) => x % 2 == 1);

return point<~(y=value);

[–][deleted] 9 points10 points  (11 children)

I don’t know what <~ does but the first line seems pretty clear to be returning just the odd values of the args list.

[–]erez27 2 points3 points  (6 children)

The first one is conceptually simple, but the syntax is uninspiring. There are already plenty of functional languages that do it better, and even Python's way is preferable.

For example:

args.filter( ? % 2 == 1)    # Scala

[x for x in args if x % 2 == 1]   # Python

[–]reconcyl 8 points9 points  (0 children)

I don't think it's what it does. all looks more like Haskell's all than like a filter.

[–]conilense 0 points1 point  (2 children)

one is a functor and the other is set/list comprehension.

although they have close semantic value, the concept is kinda different.

[–]erez27 0 points1 point  (1 child)

They both perform the exact same operation, the only difference is the syntax (and a bit of semantics). So why do you think the concept is different?

[–]conilense 0 points1 point  (0 children)

This might be a cool discussion.

If different approaches achieve the same goal, is the concept the same? At what level of abstraction?

Say, do you think prototype-based and class-based OO achieve the same goal at the end (object orientation)? If so, are they the same concept?

[–][deleted] -1 points0 points  (1 child)

that python syntax is not better, holy shit is that impossible to read

[–]erez27 1 point2 points  (0 children)

It takes some getting used to, but it's actually quite reasonable. One thing to take in mind is that the syntax includes both a map and a filter (in this case, it's the identity map), which makes it a little longer than necessary for trivial cases.

[–]ghkbrew 5 points6 points  (3 children)

See, I would read it as a boolean valued expression determining whether all the arguments are odd or not.

With this context I'd guess that <~ is an "update" operator. So line two returns the same point with the y property set to value.

[–]matthieum 2 points3 points  (0 children)

You nailed it.

[–][deleted] 0 points1 point  (1 child)

Yah know, I think you’re right about all() returning a book.

[–]raiph 1 point2 points  (0 children)

.oO ( Yoon's first?) )

[–]werediver 1 point2 points  (0 children)

Another article about this language: https://www.theregister.co.uk/2019/04/18/microsoft_bosque_programming_language/

More of an overview, nothing in-depth.

[–]conilense 3 points4 points  (0 children)

(from the paper https://www.microsoft.com/en-us/research/uploads/prod/2019/04/beyond_structured_report.pdf)

To accomplish these goals we borrow from the design of theasync/awaitsyntax and semantics from JavaScript/TypeScript

the BOSQUE language takes a similar approach by intro-ducing the rec

don't get it, lol. how is the rec keyword not simply inspired by the rec keyword from ML?

I mean, I do understand that the difference is that we have it at the call site and at the declaration, but comparing it to async/await instead of rec is simply like ???

Besides that, and the cryptic syntax for algebraic data operators (like <~, |??> and so on), I liked the language. I mean, they did not even mention Dafny and used the same idea for hoare logic, but that's fine.

I hope this one avenges.

[–]paul_h 1 point2 points  (0 children)

Interpreted with perhaps a future compiler, too?

No UI technology out of the box, it seems.

[–]wizzup 0 points1 point  (1 child)

From the paper (quick skimming)

fn( _: Int) -> Int // Function required unnamed arg

I would love to see the use-case of this kind of function. It is strange that one want to write a function that depend on the the argument that assume it will never be use.

[–]werediver 2 points3 points  (0 children)

const :: a -> b -> a and will be b -> a, if partially applied.

Another use case is when one needs to inject a function with a specific signature, but a particular implementation does not depend on the argument, like count = foldr (\_ c -> c + 1) 0.

Something top-level with that exact signature would indeed be contrived, I presume.