14 ms·
Bosque Programming Language
- bodiam 8y agoHi all, Bosque seems to be a very interesting language. I couldn't help but notice the similarities between Bosque and Kotlin, so I wrote a blogpost comparing Bosque with Kotlin: https://www.jworks.io/tictactoe-in-bosque-and-kotlin/ https://www.jworks.io/tictactoe-in-bosque-and-kotlin/
- magicmouse 8y agoi challenge the decision to not have explicit loops. the beauty of the original C construction was that it allowed for 3 events to occur inside each iteration: 1) normal execution of the body, 2) skip over the body but increment the counter, 3) exit the loop. When you have nested loops JS and AS3 let you name the outer loop and break out of it (thus re-introducing the FORTRAN GOTO which although that crank Dijkstra hated so much, occasionally is needed for this purpose). How are you going to stop a loop that might go on too long? sometimes you want to stop early. I don't see how you can stop the map().. or filter() operators. Just because early abort of a loop is not common doesn't mean it doesn't come up; it does inevitably so.
- dragonwriter 8y agoNamed loop breakouts aren't the e GOTO Djikatra was concerned aboutvbecause they are still block structured; “harmful” GOTOs are arbitrary, structure-defying jumps. Named loop breakouts do not break the coordinate-assignment capacity that Djikstra takes GOTOs to task for breaking. > I don't see how you can stop the map().. or filter() operators. You use an early-terminating operator like find or take. (The general solution is probably Clojure-style transducers, which compose in a way which enables, among other things, plugging termination conditions into an operator which otherwise isn't early terminating.)
- magicmouse 8y agoAlso, there is a slack group dedicated to future programming languages. I am the acting char of the next gen language developer's association, and am trying to get all the next gen language designers to be in communication with each other. Right now there is the Luna project (poland), Red, Parasail, Beads, Elm, Dark, and others. i will be sure to add an entry in our database for Bosque.
- magicmouse 8y agothe slack group is https://futureofcoding.slack.com/ https://futureofcoding.slack.com/
- externalreality 8y agoYet another programming language. I wish I was that rich that I could just throw money at people to develop yet another programming language. I think at this point programming languages do more harm than good. Why, because some poor fellow is going to spend time that he could be using to cure cancer but instead he reinventing the wheel in some language that he is going to be sick of by time he if 35 - 40 years of age and realizes that language evangelism is a scourge upon the face of mother Earth.
- brudgers 8y agoBecause Bosque has Visual Studio integration, I suspect it's purpose is related to that. A DSL for the purpose of integrating its abstractions into existing mainstream tools...a language built to investigate and solve Microsoft's problems. Maybe it becomes mainstream. But like most programming languages, it's unlikely because most individuals and organizations aren't trying to solve the problem it was built to solve.
- WalterGR 8y agosome poor fellow is going to spend time that he could be using to cure cancer... Wait til you hear about “forums” on the web. People spend an incredible amount of time arguing about things in “comments”, when they could be curing cancer.
- externalreality 8y agoNo, people don't argue about stuff on web forums. That's crazy.
- tunnuz 8y agoI respectfully disagree, some do.
- tiuPapa 8y agoHow dare you disagree? Now I will start a completely unrelated rant about how disagreement is the root cause of all evil and is indeed the real scourge on the face of the earth. (And not multiple programming languages, that some poor soul is falsely led to believe. Just think about it, we have more than one programming language because a misguided fellow disagreed that rocks and stones are the ideal way to program. So you see that disagreement is the reason why we have so many programming languages today. It's always a disagreement that brings suffering and pain.)
- ptrott2017 8y agoDirect link to github repository: https://github.com/Microsoft/BosqueLanguage https://github.com/Microsoft/BosqueLanguage
- mrkmarron 8y agoHi project owner (Mark) here. It is a bit late in the evening for me but I will try to answer any questions when I can. The Bosque language is currently in a very early state with lots of work to do and not ready for practical use. However, I am very excited by the potential in the concepts and wanted to make the project a collaborative endeavor, including both other academics and developer community, from the start. At this point the goal is to explore interesting options in the language design space – whether the Bosque language becomes mainstream or just provides useful ideas for other languages to adopt. So, please take a look, expect plenty of rough edges, and we would love comments, suggestions, and PR’s on the GitHub repo.
- cmroanirgo 8y agoI was keen to read about this lang bc it came from m$, but this looks like it needs some work: I'd highly suggest changing "var" and "var!" definitions. From your doc: >var z = 5; z = y; //error z is not updatable "var" is shorthand for 'variable' as you're no doubt aware, so use "const", or use something else altogether to indicate a var. I stopped reading after coming across your unintuitive "var!" syntax. Let an apple be an apple and an orange an orange.
- logicallee 8y agoCould you comment on how you came up with the name, or its meaning?
- mrkmarron 8y agoIt is a Spanish word used in the SouthWest US for forest along a river. No particular reason behind the name, just a unique and easily searchable choice.
- logicallee 8y agoOh okay. I thought it might have something to do with Basque: "Basque is a language spoken in the Basque Country, a region that straddles the westernmost Pyrenees in adjacent parts of northern Spain and southwestern France. Linguistically, Basque is unrelated to the other languages of Europe and is a language isolate to any other known living language." I didn't know about the forest meaning at all. (Maybe a subconscious influence, if you've ever heard any reference to Basque.)
- djhaskin987 8y agoA project language with a reference implementation written in...TypeScript? O.o
- Lowkeyloki 8y agoThis doesn't surprise me. The sample code in the documentation strongly reminded me of Typescript.
- emmanueloga_ 8y agoWhy is this strange?
- bartschuijt 8y agoSee also chapter 3 in the paper: https://www.microsoft.com/en-us/research/uploads/prod/2019/04/beyond_structured_report_v2.pdf https://www.microsoft.com/en-us/research/uploads/prod/2019/0...
- quickthrower2 8y agoLooks a lot like TypeScript to me.
- _bxg1 8y ago"The Bosque programming language is designed for writing code that simple, obvious, and easy to reason about for both humans and machines. The key design features of the language provide ways to avoid accidental complexity in the development and coding process. The goal is improved developer productivity, increased software quality, and enabling a range of new compilers and developer tooling experiences." Along with literally every other language. I really wish the splash pages for new languages would cut the boilerplate and just open with a list of the specific traits that make this one different from its peers. Edit: it appears that this is relatively easy to find after visiting the repository. Still, that opening paragraph is meaningless, and many languages don't even make the worthwhile bits easy to find for those who actively seek them.
- _bxg1 8y agoThe typed strings feature looks pretty cool.
- DarkWiiPlayer 8y agohttp://terralang.org/ http://terralang.org/ does a good job at telling you right away 1. what it is, 2. what it looks like and 3. what makes it different. I could write lots about how the language is great, but I also just realized that its home pages is pretty good for a programming language.
- hacker_9 8y agoOnly thing that caught my eye is the require syntax, which is nice, but then I thought what happens if this contract fails? Its possible you'd want to return false, or raise exception, or log error, or even correct value and continue. So whilst a nice feature, not practical IMO if it would always result in an exception.
- UK-AL 8y agoI don't think they are runtime checks
- hacker_9 8y agoHow not? method makeAutoMove(mark: String[PlayerMark], rnd: Int): Game requires !this->hasWinner(); method makeExplicitMove(x: Int, y: Int, mark: String[PlayerMark]): Game requires !this.board->isCellOccupied(x, y); If I'm reading it right though, it looks more like it simple doesn't execute the function at all instead of throwing etc. So yet another possible route to deal with an invalid contract.
- asimpletune 8y agoIt could be checked at compile time no?
- Sean1708 8y agoHow would you check them at compile time without using dependent types (at least it doesn't look to me like these are dependent types)?
- mshockwave 8y ago> Thus, Bosque does not have any undefined behavior I think this is the one that should be highlighted most. Otherwise, from an engineering perspective, many of the other language features have already been implemented and widely used in other languages
- emmanueloga_ 8y agoI think I remember someone talk about undefined behavior in specifications and how it is actually a good thing, in the sense that offers increased liberty for implementations and some other advantages. Anybody else has heard this? Don't quite remember where I read it. My humble opinion aligns with yours, it seems intuitively "better" to have no undefined behavior. https://en.wikipedia.org/wiki/Undefined_behavior#Risks https://en.wikipedia.org/wiki/Undefined_behavior#Risks
- a1369209993 8y agoThat was the original rationale for introducing (formally) undefined behavior in the original C standard. Malicious optimization is a after-the-fact perversion of it.
- c256 8y agoEspecially in C-like languages, undefined behavior is one of the main things that creates space for compilers to get better (produce faster code, or produce code faster, or smaller, etc). That topic comes up in compiler discussions every so often; I would hazard a guess that one of those references is what you have in mind.
- dkersten 8y agoYes, I've heard the same thing. The C and C++ specifications specifically mention that some things are undefined behaivour, that shows that its not something that slipped through the cracks (at least in those cases) but rather a conscious decision to leave it undefined. This only makes sense if its done to allow the compiler room to do things like aggressive optimisation. I only wish that undefined behaviour in C++ were harder to accidentally use, or at least, if the compiler warned me "hey, I'm gonna do X here because that undefined behaviour here allows me to do so, this may not be portable to other compilers and may not be what you wanted, you've been warned!"
- pmontra 8y agoA random thought about the code samples. What do we gain from having to write point<~(y=value) instead of other languages' point.y = value ? I believe that syntax should be designed to make things simple for developers, not for the designers of languages or for compilers.
- emmanueloga_ 8y agoI don't know anything about the language but the first form suggests immutability (return a new point with the y property = to value), the second looks like mutating a struct
- garmaine 8y agoI don't see anything intrinsically different about the two. If anything the established notation of mathematics for hundreds of years is that '=' implies immutability.
- titanomachy 8y agoThe second example suggests to me that `point` already exists, and we're mutating it by changing the value of its `y` property.
- ken 8y ago<~ looks like an expression for a bulk update of an immutable record. "point.y = value" is typically a statement for a single update of a mutable record. I'm not sure how you'd extend the latter to support the features of the former. The meaning is completely different. Different things should look different.
- auggierose 8y agoI think this is nicely solved in Swift.
- 8y ago
- mhd 8y agoAm I the only one who really can't stand the expression "easy to reason about"? Everywhere you look everything that isn't exactly CORBA, ASN1., EJBs or XMLs is E2RA...
- quickthrower2 8y agoI thought "easy to reason about" was reserved for pure functional programming languages :-)
- eitland 8y agoAnd modern EJBs are actually not to bad either : )
- quadcore 8y agoPaper: https://www.microsoft.com/en-us/research/uploads/prod/2019/04/beyond_structured_report_v2.pdf https://www.microsoft.com/en-us/research/uploads/prod/2019/0...
- xiaodai 8y agoFix the grammatical error: The Bosque programming language is designed for writing code that simple, obvious, and easy to reason abo
- mcintyre1994 8y agoTyped strings look really nice, something I tend to wish every language had eventually - though I'm not sure why you'd limit them to Strings and not allow them for all types? I really like the Logarithm example shown in the Dotty docs for instance: https://dotty.epfl.ch/docs/reference/other-new-features/opaques.html https://dotty.epfl.ch/docs/reference/other-new-features/opaq...
- mrkmarron 8y agoThere were some discussions for a more general system -- e.g. Int[Seconds] would be a typed int indicating the contents represented seconds. We needed to think more about all of these usecases and how things worked so we decided to start with just strings as the most useful. It is great to see you had the same idea though and would definitely like to revisit this in the future.
- mcintyre1994 8y agoTo be fair Strings would solve a problem I have right now with Scala pre-Dotty, our object IDs are all strings and the compiler does nothing to stop you using a user ID in a method that expects a contact ID, etc. For your Int[Seconds] example, I haven't used them at all but could it work something like the F# measures concept? That seems sort-of similar but more general from scanning the docs.
- mpartel 8y agoReading the publication, I don't see that big a difference to existing purely functional languages. It almost reads like a rediscovery and refinement of the main value propositions of e.g. Haskell. That said, some of the refinements, especially the (TypeScript-inspired?) record typing and manipulation facilities, look quite pleasant.
- cabalamat 8y agoSome comments on the code, based on Tictactoe example (https://github.com/Microsoft/BosqueLanguage/blob/master/docs/tictactoe.md https://github.com/Microsoft/BosqueLanguage/blob/master/docs...): 1. overall quite nice looking and easy to understand 2. too verbose in places, e.g. this constant structure: const winPositionOptions: List[List[[Int, Int]]] = List[List[[Int, Int]]]@{ List[[Int, Int]]@{ @[ 0, 0 ], @[ 0, 1 ], @[ 0, 2 ] }, List[[Int, Int]]@{ @[ 0, 1 ], @[ 1, 1 ], @[ 2, 1 ] }, List[[Int, Int]]@{ @[ 0, 2 ], @[ 1, 2 ], @[ 2, 2 ] }, List[[Int, Int]]@{ @[ 0, 0 ], @[ 1, 0 ], @[ 2, 0 ] }, List[[Int, Int]]@{ @[ 1, 0 ], @[ 1, 1 ], @[ 1, 2 ] }, List[[Int, Int]]@{ @[ 2, 0 ], @[ 2, 1 ], @[ 2, 2 ] }, List[[Int, Int]]@{ @[ 0, 0 ], @[ 1, 1 ], @[ 2, 2 ] }, List[[Int, Int]]@{ @[ 0, 2 ], @[ 1, 1 ], @[ 2, 0 ] } }; Has types defined in 10 places, 9 of which are redundant. Also you are using @{...} for lists and @[...] for tuples; a more usual convention (in e.g. Python or Haskell) would be [...] and (...) respectively. 3. String types aren't intuitive (at least to me). E.g. in this code: const playerX: String[PlayerMark] = 'x'#PlayerMark; It appears that a String[PlayerMark] is a subset of String that can have the values 'x' or 'o'. I would have preferred something like: type PlayerMark = 'x' | 'o'; type PlayerMarkOrBlank = 'x' | 'o' | ' ';
- GordonS 8y agoGot to say, after reading the description in the linked URL, I was really surprised with just how complex the syntax is in the code samples. I don't want to be overly negative, but it doesn't look like it's going to reduce complexity to me - if anything it looks like one of the most incomprehensible languages I've come across in decades of experience.
- mimixco 8y agoI agree! Human-readability may have been a goal, but it wasn't a top priority.
- velcrovan 8y agoPlease consider using a license other than MIT. MIT assumes all contributors work for a single institution, and doesn't protect licensees from later patent infringement claims. https://writing.kemitchell.com/2019/03/09/Deprecation-Notice.html https://writing.kemitchell.com/2019/03/09/Deprecation-Notice... Either Apache 2.0 or Blue Oak Model would be better choices.
- azhenley 8y agoI don’t know much about licenses but last week I added a license to one of my GitHub repositories for the first time. GitHub seemed to be heavily pushing MIT as the default. If the MIT license assumes everyone works at the same place then that seems horrible for GitHub repositories, right?
- teddyh 8y agoHorrible for who? Who would it be horrible for, who would it benefit, and who is in a position to decide what the default is? Cui bono?
- velcrovan 8y agoHorrible in the sense of being an obvious mismatch for how development happens on GitHub, which pretty much exists to make contributions easy across institutional boundaries. No one benefits from the choice of MIT as a GitHub default. It's a quagmire of legal confusion borne out of pure ignorance.
- teddyh 8y ago> GitHub, which pretty much exists to make contributions easy across institutional boundaries No, GitHub exists to somehow benefit the current owners, Microsoft, however they decide is the best way. > No one benefits from the choice of MIT as a GitHub default. Actually, there is a good argument to be made that Microsoft actually benefits from MIT being the default, as nickpsecurity pointed out in a sibling comment.
- jsjolen 8y ago>For typed strings, String[T] the compare operator ignores the generic type and is based on the order of the underlying raw string e.g. both arguments are coerced to String. Why? What even was the point in making them 'typed' then? Also, what exactly are the relevant language-level details which BOSQUE contributes? It seems more like a large library than anything else.
- raylu 8y ago> Why? What even was the point in making them 'typed' then? To prevent you from passing a String as a String[Zipcode].
- bfrydl 8y agoThe description suggests the syntax and type system are based on TypeScript. After looking through the docs I have to say I wish this were much more true. It seems like Microsoft Research has thrown out half the good ideas TypeScript has in favor of overly noisy, complex syntax.
- SlowRobotAhead 8y ago>Bosque programming language is designed for writing code that simple, obvious, and easy to reason about for both humans and machines. var v: List[Int ?] = List@{1, 2, none, 4}; OK! I think it needs some work. AM I supposed to intuitively know what ? and @ mean?
- hardtoreason 8y ago"Easy to reason about" doesn't mean "Doesn't require you to read any documentation."
- SlowRobotAhead 8y agoOk, and simple, obvious,?