34 ms·
Bosque Programming Language
- mpoteat 6y agoThis is pretty cool. This project has a long way to go before it's mature, but as someone who uses Typescript every day professionally, the promise of the ease and safety of Typescript coupled with the speed of C++ is really compelling.
- pjmlp 6y agoYou can already play with something like that, Static TypeScript, used on MakeCode for targeting embedded devices. https://www.microsoft.com/en-us/research/publication/static-typescript/ https://www.microsoft.com/en-us/research/publication/static-... Microsoft MakeCode: from C++ to TypeScript and Blockly (and Back) https://www.youtube.com/watch?v=tGhhV2kfJ-w https://www.youtube.com/watch?v=tGhhV2kfJ-w https://www.microsoft.com/en-us/makecode https://www.microsoft.com/en-us/makecode
- 52-6F-62 6y agoThis is cool, thanks for sharing. I'm rather in the same boat as OP.
- m0llusk 6y agoThe core ideas are kind of interesting, but in my experience where cool new language ideas come apart at the seams is when they are built out to completeness with libraries, packaging, configuration management and the rest. > ... The current focus of the Bosque project is core language design. As a result there is no support for packaging, deployment, lifecycle management, etc. ... So there is nothing solid there yet and thus significant risk that like many other languages this offering will suffer metastasis, bloat, and conflicts as it grows to be useful for solving real problems.
- mpoteat 6y agoOh yeah, I completely agree. To a certain extent it's best to be risk averse with things like this, especially when working on professional problems. npm has spoiled me, so I doubt I'll ever try to use a language in anything other than a hobby capacity without a very good package manager and corresponding community of functionality.
- xixixao 6y agoI gotta say you lost me at args->allof It’s 2020, if you’re really serious about building a new language, shouldn’t you at least pick a reasonable naming case convention? (allOf, AllOf, all_of, all-of would all work) (Not talking about the fact that allOf doesn’t seem very consistent with other languages...)
- TylerE 6y agoall-of should not work unless your syntax for basic arithmetic is something heinous.
- munro 6y agoOr you're Lisp
- traes 6y agoOr you require whitespace in arithmetic.
- cygx 6y agoOr The Language Formerly Known as Perl6 [1], where it won't cause much friction as variable names ordinarily start with a sigil. [1] https://docs.raku.org/syntax/identifiers#Ordinary_identifiers https://docs.raku.org/syntax/identifiers#Ordinary_identifier...
- benibela 6y agoOr XPath
- shakna 6y agoRefusing to allow symbols in identifiers might make some things easier to read, but is annoying as hell if you're touching anything scientific. If you have something clear you break tokens on, like whitespace (except within quotes), then you should have no problems allowing arbitrary symbols inside an identifier.
- 6y ago
- deleted 6y ago[deleted]
- chunsj 6y agoAt first site, it seems like a Swift clone. However, there surely be some reasons that I cannot catch.
- tomp 6y agopreconditions, looks like they try to "prove" them by using Z3 theorem checker
- cryptonector 6y agotypedef Letter = /^\w$/; typedef Digit = /^\d$/; Shades of Perl5. Paging jwz!
- keyle 6y agoI like it already. But the page has a mix of statements ending with ';' and not. Which is it? Pick one and stick to it ;), it triggers my ocd more than naming interfaces 'concepts' and classes 'entity' for what seems like the heck of it. It does look swiftish and ceesharpy. But hey, if I can get something that looks like that, compile down to a small binary as fast as C++, I'll call your interface 'concepts' all day.
- throwaway_pdp09 6y agoI agree about the arbitrary renaming just to make the language syntactically a bit distinct from other languages, while messing around the user. It really is not a big issue but the fact they chose to make it an issue at all by picking a new name for an existing concept is worrying.
- Areading314 6y agoWhy would someone use this over Kotlin? Seems like Jetbrains has a big head start over this project without much difference in stated objectives
- mrkmarron 6y agoHi, project owner here, great to see this on HN and always happy to hear from folks here and on the GitHub repo. We also have a webinar with Q&A scheduled for Thursday morning (https://note.microsoft.com/MSR-Webinar-Programming-Languages-Bosque-Registration-Live.html https://note.microsoft.com/MSR-Webinar-Programming-Languages...) which may be of interest as well.
- sachinjoseph 6y agoThe use use of '=' here scares me: function add2(x: Int, y: Int): Int { return x + y; } add2(2, 3) //5 add2(x=2, y=3) //5 add2(y=2, 5) //7 The language already supports '=' operator for assignment of variables in the current scope, so should you use the same operator for denoting value assignment formal parameters in a function call? This can lead to a lot of confusion between variables in the scope and formal parameter names in a function that is called from the current scope.
- dmix 6y agoThis and a few other parts seem to be inspired by StandardML / Ocaml https://learnxinyminutes.com/docs/standard-ml/ https://learnxinyminutes.com/docs/standard-ml/
- tomp 6y agoPython, one of the most popular languages, uses this syntax, so I'm guessing the vast majority of people don't find it scary (I certainly don't).
- dkersten 6y agoThis seems like a non issue to me and as tomp said, is already done in popular languages without problems. The third example (keyword arguments before positional) does seem a bit odd though, as interleaving positional and keyword arguments seems like a recipe for confusion, but using = for keyword arguments doesn’t seem like a problem to me.
- garyclarke27 6y agoI love this feature - calling named parameters is (for me) a glaring omission from Javascript (and surprisingly Typescript), I know you can define an object argument, but not many do and that’s not very elegant.
- anthk 6y agoWhy did you name your language on "woods"?
- nwatson 6y agoIn English "bosque" is a specific type of forest/woods ... https://en.m.wikipedia.org/wiki/Bosque https://en.m.wikipedia.org/wiki/Bosque, could be named for that too. (Bosque is a generic "woods" in Spanish/Portuguese.)
- wizeman 6y ago> As a result of these design choices there is always a single unique and canonical result for any Bosque program. This means that developers will never see intermittent production failures or flaky unit-tests! So Bosque programs are not allowed to receive input from the outside world? > When an error occurs in deployed mode the runtime simply aborts, resets, and re-runs the execution in debug mode to compute the precise error! Again, no interaction with the outside world? Or are all inputs recorded during the entire execution? It doesn't seem like this could work as specified in many real-world scenarios... EDIT: > This compiles recursive functions into a CPS form that uses constant stack space, eliminating any possible Out-of-Stack issues So recursion cannot depend on input from the outside world? Either 1. I'm missing something, 2. Bosque programs indeed cannot receive input from the outside world, or 3. these claims seem a bit exaggerated...
- dkersten 6y ago> Again, no interaction with the outside world? Or are all inputs recorded during the entire execution? Inputs would need to be cached (eek, if there’s a lot of state loaded from external services or databases, or if that state is sensitive and you want to control where it may get persisted), but more importantly, output needs to be not output on the rerun (eg database writes and api calls). > So recursion cannot depend on input from the outside world? I’ve made a few mini languages (mostly for fun or for myself, but also external DSLs for end users) and I’m a big fan of not allowing unbounded loops. (Although bounded by a dynamic value like an input or the length of a runtime list is ok, so not quite the same thing as described here, it just needs to know the number of iterations before the loop begins) It makes it much easier, in my opinion, to prevent bugs, but of course it does mean you give up expressive power, so while it works for DSLs it’s not great for general purpose languages. I’m also a big fan of synchronous programming languages. I made one that basically runs inside a database transaction and reruns on conflict.
- wizeman 6y agoSure, but they are not simply saying that they do not allow unbounded loops, that is what some languages do already, like Coq. They are saying that the compiled program "uses constant stack space, eliminating any possible out-of-stack issues". This seems impossible unless recursion cannot depend in any way on inputs from the outside world. Mind you, even if you have constant stack space that does not mean that you won't run into an out-of-stack issue. You can still run out of stack space if it is constant, because it might not fit in memory. It would probably be trivial to construct such a program. Furthermore, a program with constant stack space may even run out of stack space during execution (due to the kernel overcommitting memory, for example).
- throwaway_pdp09 6y agoYeah, but what is it? > The Bosque programming language is a breakthrough research project from Microsoft Research. Tells me nothing useful about it. > Bosque simultaneously supports a high productivity development experience expected by modern cloud developers, coming from say a TypeScript/Node stack, It's a web language then? > while also providing a resource efficient and predictable runtime with a performance profile similar to a native C++ application Or a back-end dev language? Come on, what is it for?
- norswap 6y agoDoes a language really have to aim for a specific use case?
- thrower123 6y agoIt would be good for its own sake to provide some motivation for why you'd bother using it over the dozen established alternatives with mature ecosystems and tooling.
- TomMarius 6y agoIt's a language research project. > In the Bosque project we ask the question of what happens if the IR is designed explicitly to support the rich needs of automated code reasoning, IDE tooling, etc. With this novel IR first perspective we are exploring a new way to think about and build a language intermediate representation and tools that utilize it. Our initial experiments show that this empowers a range of next-generation experiences including symbolic-testing, enhanced fuzzing, soft-realtime compilation with stable GC support, API auto-marshaling, and more!
- throwaway_pdp09 6y agoThen tell us this. In fact stick it somewhere obvious. Also please talk straight, please don't mention "next-generation experiences", that's just marketing nothingspeak to HN techies. "enhanced fuzzing" - as opposed to what? "soft-realtime compilation" - meaning...? "stable GC support" - oh thank god for that, finally GC is reliable and can be used in production. thankyou thankyou thankyou for banishing GC instability.
- still_grokking 6y agoLooks like Stainless Scala, mixed with Rust, and given a C++ syntax. This mix looks interesting as such. But of course Wadler's law applies: Why THIS syntax? Looks like a blast-from-the-past, bloatty and complex. Modern languages go mostly for some more lightweight look-and-feel. Usually more "pythonic". This would be imo also here the better idea.
- HelloNurse 6y agoA lot of punctuation, most of it painful: * arrow and double arrow * arrow and double colon * apparently random semicolons Not all syntax choices are bad (for example, consistently declaring types after things with a colon as a separator), but certainly not coherent and elegant enough to compete with Python, C/C++/Java, Lisp, etc.
- PhoenixRobo 6y agoI'm not sure how it supports "modern cloud developers, coming from say a TypeScript/Node stack" with that syntax.
- nonsince 6y agoAt this point any new systems language aiming at productivity has to prove itself not just superior to C++, but superior to Rust, without being significantly worse in any aspect. It’s already suspicious by virtue of having a hand-wavy "Int" type (what size/signedness is that?) and it appears to be object-oriented (so we have to rely on compiler optimisations to remove dynamic dispatch) and garbage-collected (so by default any non-trivial type is heap-allocated). These are just ways in which it is worse than Rust as far as performance goes, since "ergonomics"/"productivity" is so subjective. It seems to improve on C++ only by taking the most common C++ patterns and building them into the language so the language doesn’t have to be so immensely complicated, while also improving the syntax. That’s simply not enough for a modern language to be competitive.
- occamrazor 6y agoA better C++ could be an attractive proposition. There are precedents of succession languages which improve on existing ones, like eg. Coffeescript, Kotlin (at least at the beginning), Reason.
- wwright 6y agoHave you used Rust? It doesn’t have backwards compatibility with C++, but the semantic model really is very similar to modern C++, just without hundreds of the footguns.
- curryhoward 6y ago> It’s already suspicious by virtue of having a hand-wavy "Int" type (what size/signedness is that?) and it appears to be object-oriented (so we have to rely on compiler optimisations to remove dynamic dispatch) and garbage-collected (so by default any non-trivial type is heap-allocated). These are just ways in which it is worse than Rust as far as performance goes, since "ergonomics"/"productivity" is so subjective. While I agree that this language doesn't seem to be differentiated enough to compete, I disagree with your apparent premise that new languages need to be as fast as Rust. I personally would welcome a new language that gives me full-spectrum dependent types with great tooling and moderate performance. There are many aspects to programming languages beyond raw speed. The world has enough cookie cutter procedural and OOP languages. I'd love to see a new language from a different paradigm succeed.
- rossng 6y agoThe language doesn't seem like the interesting part here. Bosque appears mainly to be a vehicle for exploring a different way of thinking about compiler IR. From the MSR site[1]: > In the Bosque project we ask the question of what happens if the IR is designed explicitly to support the rich needs of automated code reasoning, IDE tooling, etc. With this novel IR first perspective we are exploring a new way to think about and build a language intermediate representation and tools that utilize it. Our initial experiments show that this empowers a range of next-generation experiences including symbolic-testing, enhanced fuzzing, soft-realtime compilation with stable GC support, API auto-marshaling, and more! [1] https://www.microsoft.com/en-us/research/project/bosque-programming-language/ https://www.microsoft.com/en-us/research/project/bosque-prog...
- dunk010 6y agoI know that Microsoft are all about grabbing as much developer mindshare as possible these days, but does nobody remember Steve Yegge and is Grok system at Google? It's basically this, just ten years ago. Having the IR not throw away anything so that the tooling can have a richer interaction. I guess the best way to be successful is to bury your sources.
- sterlind 6y agoGrok seems to have been open-sourced as Kythe, and I suspect it was significantly nerfed like other things they've released (e.g. bazel) Additionally, it looks like Kythe was never fully stabilized, and there's been no widespread usage of it. It's shovelware. I don't think you should blame MS for not citing an internal tool that they never properly released.
- goto11 6y agoThe Roslyn C# compiler also doesn't throw anything away - you can recreate the source from the AST, completely with white-space and comments. This is necessary to support safe refactorings, so I don't think this is a novel idea. IntelliJ must have supported something like this for ages. Bosque sounds like something beyond Roslyn, but it is not clear to me what.
- stared 6y ago> is a breakthrough research project [citation needed] In all seriousness, each time when I see a project self-describing itself as a breakthrough, it is a red flag. No matter if it is programming, mathematics, arts, or anything. (Of course, unless used ironically.) Either, it is a huge ego and a total lack of self-skepticism (vide Stephen Wolfram's recent Theory of Everything) or fiddling of the marketing department.
- sfvisser 6y agoI just read this as "within the context of MS research projects — maybe even specifically in the category of programming languages — Bosque has a relatively high breakthrough value". But I might be wrong here.
- wolfspider 6y agoIf you have worked with F* or Low* then you probably have some exposure to using Z3 and getting this kind lexical analysis from it is a breakthrough. I just wish Z3 was available on more platforms by default.
- norswap 6y agoCool. Could you maybe just read ahead and evaluate the claim for yourself and then post a comment about that if you end up agreeing/disagreeing with it?
- ken 6y agoI read through the whole readme. I can’t figure out which part of this they think is the “breakthrough”.
- wincent 6y agoThey are probably overselling it but I just scrolled straight past that to evaluate the feature list, and I definitely like some of the things in it: nominal data types with invariants, validated strings, pre/post-conditions, familiar TypeScript-like syntax etc.
- 6y ago
- tluyben2 6y agoHow does the verification work? I see the Z3 prover in there; is there more detail on how that works with this language?
- mrkmarron 6y agoThe design of the language is done in a manner that allows us to translate the code (and all conditions) into very friendly SMTLib code -- that we don't need to add a lot of additional checks like frame rules or havocs and where the set of theories (and their combinations) are well behaved. We have some info on this in the research papers section and documents but are planning on a full paper focused on how this is done (particularly in the presence of union types, dynamic records/tuples, etc.)
- unnouinceput 6y agocross eyes to the syntax....confused: -is this a crossover between C and Pascal?
- realharo 6y agoIs the type system at least as rich (or richer) than TypeScript's? Can I do stuff like `Partial<T>`, `Omit<T, K>` intersection types, etc? Is structural typing the "default"?
- deleted 6y ago[deleted]
- gigatexal 6y agoHyperbole aside perhaps we should tinker with the language first thereby walking a mile in the creator’s shores before passing judgment that its a terrible language.
- k0t0n0 6y agoI don't wanna type function to define a function.
- IshKebab 6y agoThe first feature says all values are immutable, but then the very next one mutates a variable. What?
- devinj 6y agoThe snark and meanness in this HN thread is totally uncalled for and why people don't publish code. I can't believe this thread is on the front page together with https://news.ycombinator.com/item?id=23157783 https://news.ycombinator.com/item?id=23157783 . Go read that, especially the ending comments on open source. > I made this thing that I thought was cool and I gave it away, and what I got back were occasionally friendly people who nicely requested things from me, but more often angry users who demanded things of me, and rarely anyone saying thanks.
- zenexer 6y agoThe issue here is the link; it doesn't do a great job of explaining _why_ Bosque is breakthrough. A bold claim like that needs evidence. What's special here? From glancing at the code snippets--which is really all we have in the way of evidence on that page--I see an interesting language concept, but it's not entirely here how that relates to the initial claim. There are definitely some interesting elements, though. It looks like it borrows a lot from TypeScript and C#, then attempts to make the resulting syntax a bit stricter with various forms of contracts. I think the goal is to make stronger guarantees at compile-time and promote better design practices. That, in turn, can result in faster applications because the compiler can make more assumptions. If that is the goal, it needs to be explained more clearly in the readme before receiving widespread publicity, and there needs to be text explaining how each feature achieves that goal. A big part of developing a new programming languages is selling it: you have to convince a lot of opinionated people that it's worth their time and energy to invest in learning your technology. Ideally, these arguments would be written during the design process before implementation even begins, so I don't think it's unreasonable to expect that they be available in the readme. This might be a better link for the HN post: https://www.microsoft.com/en-us/research/project/bosque-programming-language/ https://www.microsoft.com/en-us/research/project/bosque-prog...
- LudwigNagasena 6y agoThis is a much better link. Bold vague buzzwords on the GitHub page ("a breakthrough research project", "a high productivity development experience", "an unprecedented tooling ecosystem") inflict antagonistic mood towards the whole project.
- francasso 6y agoThis is another PL I won't try (not that the authors should care). I'm still waiting for a good "system programming language" that - has compile time execution that can call a compiler API to allow compile time code generation - full compile time reflection, optional runtime reflection - doesn't have any kind shape or form of automatic memory management - has decent discriminated unions - is not much more opinionated than C on how I should live my life - operator overloading: define at least common operators (+, *, -, etc...) for user types. Sometimes I like the idea to be able to define infix/postfix functions in general while also assigning a priority and an associativity (totally possible with a hand made parser), but I think that could easily lead to a mess if miss-used by the community. Zig is spot on for some of those. JB's Jai on others. For the rest it looks like there aren't many people that are bothered by the things I'm bothered with.
- diegoperini 6y agoTake a look at Jai. It's not released yet and doesn't cover all your bullet points but it promises speed and getting out of your way, especially if you are a game programmer who loves build pipelines and data oriented design. https://inductive.no/jai/ https://inductive.no/jai/
- bloaf 6y agoI wonder if the bones of this language came out of the work Microsoft put into Sing# 15 years ago.
- mcdermott 6y agoI stopped reading at "from Microsoft Research."...
- dleslie 6y agoI don't believe one can claim to have created a systems language if it doesn't have trivial or seamless integration with the system's C ABI.
- dleslie 6y agoHa, downvoted. Show me a successful "systems language" without such C ABI compatibility.
- nnoitra 6y agoThis is laughable - pretty much a buzzword soup. Whenever I see "this language/tool does A and B well", it turns out it can neither do A nor B well enough. >The Bosque programming language is a breakthrough research project from Microsoft Research. Breakthrough according to who?