Live data from Hacker News

Blorp Language

blorp-lang.org

51–60 of 67 posts

Re: Blorp Language

#51
post #15

Why is `pure` a keyword that needs to be added, with impure being the default? This discourages programmers from marking functions as pure. I like how Nim does it, with `func` declaring a function (pure) and `proc` declaring a procedure (impure).

> Why is `pure` a keyword that needs to be added, with impure being the default? Marketing. Instead of reading the code littered with "impure" keywords, you look at the beautiful code marked as "pure".

The LLM is just going to leave out the pure by default.

Re: Blorp Language

#52

I know there are people that are used to the indention based scope but that has a real problem when it comes to copy/pasting code. I think a alternative that still looks pretty clean is to do like Ruby and Julia and have the function/class imply begin and have a literal 'end'.

I don't understand this concern. How exactly are you copy/pasting code such that significant indentation causes "real problems"? I remember the creators of Go explained [1] that they chose explicit block delimiters because of problems they saw when embedding snippets of Python in other languages. But this seems like a very niche kind of problem. [1]: https://go.dev/talks/2012/splash.article#:~:text=we%20have%2...

Scope being determined by indention makes it easier to paste things in the wrong scope and not notice.

Re: Blorp Language

#53
It would be nice to see a "new" language that actually does something truly new and valuable.

Almost all "new" languages presented on HN are basically slightly different flavours of languages that have been around for a very long time. But without the libraries/documentation/tools etc. needed to make it useful.

Re: Blorp Language

#54
post #15

Why is `pure` a keyword that needs to be added, with impure being the default? This discourages programmers from marking functions as pure. I like how Nim does it, with `func` declaring a function (pure) and `proc` declaring a procedure (impure).

> Why is `pure` a keyword that needs to be added, with impure being the default? Marketing. Instead of reading the code littered with "impure" keywords, you look at the beautiful code marked as "pure".

An exclamation mark instead for impure would solve that.

Re: Blorp Language

#55
post #45
post #29

Earlier quoted context omitted.

That's more of a compiler limitation that became cultural for a while. Most languages (both natural and artificial) use delimited structures sparingly and rely more on other cues. It sometimes appears spontaneously (e.g. "∫ dx f(x)" is logically fine, but feels wrong) but in general it's rare. The move away from indentation in programing came as a rebellion against the too-constraining fixed column languages, in the…

In my experience there are many problems with significant whitespaces, things like copying pieces of code require much more work, when indentation actually changes the logic you can not ask your tool to do it automatically - because there is no single right way to do it. Tabs vs spaces can also be a problem.

> copying pieces of code require much more work

IME, it requires less work. You just grab the piece of code you want, whereas with braces, you need to count which closing brace is the correct one.

Re: Blorp Language

#56

It would be nice to see a "new" language that actually does something truly new and valuable. Almost all "new" languages presented on HN are basically slightly different flavours of languages that have been around for a very long time. But without the libraries/documentation/tools etc. needed to make it useful.

Look at my language: https://github.com/Panzerschrek/U-00DC-Sprache/. It offers speed and safety without introducing too much friction.

Re: Blorp Language

#57
post #15

Why is `pure` a keyword that needs to be added, with impure being the default? This discourages programmers from marking functions as pure. I like how Nim does it, with `func` declaring a function (pure) and `proc` declaring a procedure (impure).

Hey... I'm the maintainer and had no idea this was posted. The reason pure is required is because it's clear and opt-in. There's a CLI subcommand called purify that will help identify pure functions that haven't been deemed so if that's desired.

But there can be many (small) applications where pure doesn't even matter, so I don't really want to force someone to write "impure" for the main function, for example.

Re: Blorp Language

#58

"Blorp" is the notional noise of kimchi or sauerkraut fermenting as the carbon dioxide escapes the airlock. Vigorous fermentation can be described as "the kimchi is really blorping along today". It's almost onomatopoetic, but not quite. We ferment wine or beer in a different vessel with different airlock, so it does not blorp. We don't have a word for that yet. The crock we used that birthed this word is this one: ht…

It's called blorp because it's the name of a stegosaurus my kids and I made up.

Re: Blorp Language

#59
post #15

Why is `pure` a keyword that needs to be added, with impure being the default? This discourages programmers from marking functions as pure. I like how Nim does it, with `func` declaring a function (pure) and `proc` declaring a procedure (impure).

Roc defaults functions to being pure, and functions that can run side effects are inferred to have a different type by the compiler based on usage. By convention, their names should also end in `!` (e.g. `transform` for the name of a pure function and `transform!` if it does side effects), and the compiler warns you if you don't follow that convention. https://github.com/roc-lang/roc/blob/b2503210da6b58a4ce1254d...

Hey - I'm the creator of Blorp, and like a lot of the ideas you have in Roc! Did you consider having opt-in purity? Or some other means of conveying impurity other than "!"?

Re: Blorp Language

#60

Interesting. there are some parts i like a lot here, but two things that I really dislike syntax wise. One is the lean towards a chainable syntax - this has proven to a big footgun for many devs in both java streams and typescript, making it very easy to go from O(n) to O(2n). The other part i really dislike is the first argument principle noted. If i myself define `string_and_reverse` and I can call it both through…

Hi, maintanier of blorp here. I think you mean that [1,2,3].map(func(x): x *2).filter(func(x): x > 5) would iterate twice, correct? Under the hood blorp optimizes that away for the functions we can. It constructs a loop and combines logic into a single iteration where possible.

Of course, blorp also allows local mutation in loops (even in pure functions, so long as the logic is contained to the function), so if there's a specific algorithm you'd rather express in a loop, you can.

Post reply on HN