4 ms·
It's a nightmare to find examples of Blech code on this website. All I could find after a dozen of clicks is zip archive to download that should contain sample
by p4bl0 6y ago
It's a nightmare to find examples of Blech code on this website. All I could find after a dozen of clicks is zip archive to download that should contain sample code in them…
Anyway, how does it compare to Lustre for example?
- tyingq 6y agoI had the same experience, but did eventually find this blog post with some example code snippets: https://www.blech-lang.org/blog/2020/08/12/push-button-handling/ https://www.blech-lang.org/blog/2020/08/12/push-button-handl... Also, figured out the "compiler" transpiles to C. Which seems reasonable given that it targets embedded real time.
- ivanbakel 6y agoThe compiler/transpiler distinction is very blurred. Nobody disputes that LLVM-IR-targeting compilers compile programs, but the LLVM IR is not an executable. `javac` "compiles" programs, but the JVM bytecode is not machine code. There's also no need to "figure out" that it compiles to C. That's in the second line of the front page.
- tyingq 6y agoI went straight to looking for code samples. Hence, "figured out". And I thought I was clear that transpiling to C made sense to me for this space. You seem to be reading something in my comment that I didn't intend to be there. Apologies for any unintended odd tone.
- turbinerneiter 6y agoMaybe don't to straight for code examples? They have a pretty good write up about the design of the language. Programmers are all hung-up on syntax, when semantics are key.
- ReactiveJelly 6y agoHere is the Rust book explaining ownership with lots of syntax-highlighted code examples: https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html https://doc.rust-lang.org/book/ch04-01-what-is-ownership.htm... The 2nd search result for "golang goroutines" is gobyexample.com, which is 1 page, half of which is code: https://gobyexample.com/goroutines https://gobyexample.com/goroutines I need to see code to understand semantics. Otherwise I'm being asked to visualize something that is better displayed on-screen. Why am I doing the computer's job?
- tyingq 6y ago"Maybe don't to straight for code examples?" Pretty sure that isn't just me. It's a common path that works better if you have the docs for it, versus "download this tar.gz file". Had I been on my desktop, that would have worked okayish. My mobile doesn't like tar.gz files, so I was stuck. It's an opportunity to grow with mimimal effort.
- amedvednikov 6y agoI guess it's the quotes you used: "compiler".
- turbinerneiter 6y agoJust read the docs in the intended order and on the second page you will find an actual example: https://www.blech-lang.org/blog/2020/06/15/decoding-the-dcf77-signal-with-blech/ https://www.blech-lang.org/blog/2020/06/15/decoding-the-dcf7... It contains some real world, which is what embedded is all about.
- deleted 6y ago[deleted]
- euske 6y agoAgreed. So much for a "new language" that doesn't want to show off what an actual code looks like.