News for hackers. Stuff that matters.
Re:Blech Programming Language by p4bl0 on Friday September 18, 2020 @08:31AM (#24515831)
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?

Re:Blech Programming Language by euske on Friday September 18, 2020 @09:26AM (#24516456)
Agreed. So much for a "new language" that doesn't want to show off what an actual code looks like.
Re:Blech Programming Language by tyingq on Friday September 18, 2020 @08:49AM (#24516012)
I 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-handl...

Also, figured out the "compiler" transpiles to C. Which seems reasonable given that it targets embedded real time.

Re:Blech Programming Language by ivanbakel on Friday September 18, 2020 @09:23AM (#24516423)
The 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.

Re:Blech Programming Language by tyingq on Friday September 18, 2020 @09:29AM (#24516486)
I 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.
Re:Blech Programming Language by turbinerneiter on Friday September 18, 2020 @10:56AM (#24517551)
Maybe 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.

Re:Blech Programming Language by tyingq on Friday September 18, 2020 @09:09PM (#24523822)
"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.

Re:Blech Programming Language by ReactiveJelly on Friday September 18, 2020 @11:08AM (#24517722)
Here is the Rust book explaining ownership with lots of syntax-highlighted code examples:

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

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?

Re:Blech Programming Language by amedvednikov on Friday September 18, 2020 @10:57AM (#24517558)
I guess it's the quotes you used: "compiler".
Re:Blech Programming Language by turbinerneiter on Friday September 18, 2020 @09:03AM (#24516187)
Just 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-dcf7...

It contains some real world, which is what embedded is all about.