Is it just me that doesnt like automatically returning the last statement in functions? It makes it hard to see where a function returns, and I dont see how you would do a guard clause at the start of a function without having the entire rest of the function in an else block
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 `string_and_reverse(42)` and `42.string_and_reverse()` i could definitely see this leading to some very funky looking chaining.
Perhaps it's just one point from me - not liking chaining :D
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.
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'.
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.
Readable syntax with mandatory indentation is a very questionable idea. For me its easier to understand that something ends with a specific designation, not with a lack of it. Indentation should be solved by formatter and not the language.
And I don't quite understand the memory model, is it something similar to Rust?
The memory management model is automatic reference counting, with some optimizations, such as perseus for compile time reference counting where possible, and copy-on-write at runtime.
I applaud the effort, but every time there's a new hobbyist programming language on HN, almost always it's something I've already seen in countless other hobbyist languages, just a slight variation of it based on the author's personal tastes. It doesn't tell me why I should adopt it over language X. What I'd like to see is exploration of novel practical ideas that would make certain types of projects much faster to write/read compared to most other languages.
For example, a typical web service I work on:
- uses JSON APIs
- it's fully stateless (uses external DBs/caches for persistence)
- has the concepts of value objects, entities, architectural layers (app, domain, infra), ports/adapters etc.
- only entities are proper rich objects, while most of the code is stateless services that operate on requests + entities + value objects
- stateless services are composed (via interfaces) into a dependency tree (stored in the dependency container)
Currently I'm playing around with an idea for a language that makes writing things like that fast and compact to read. Something like:
module my_service
layer app {
service Adder { // stateless service
uses base int // a value-based dependency, injected in the container below
method add(x int) int {
return base + x
}
}
service Doubler {
uses a Adder // delegates to another service
method double(x int) int {
return a.add(x) + a.add(x)
}
}
}
container { // dependency container construction with injections
A = Adder { base: 10 }
D = Doubler { a: A }
}
// automatically generates a web server that exposes a JSON API with method "double" and accepts the "n" argument
endpoint double(n int) int {
return D.double(n)
}
This is a synthetic example, but you get the idea (entitites and value objecst omitted here)
What do you think? Does it make sense? It basically moves something usually implemented by a framework into the language, but that's the entire point: a language optimized for writing compact, architecturally safe stateless services in a few lines of code. For example, since we know a request's memory is bound to that request (no global state), we can have very optimized memory management without a full GC => improved latency. Or for example, we can have compile-time checks for things like dependency direction validation (i.e. the domain layer cannot reference the infrastructure layer) to keep the architecture clean, etc.
"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:
Yes, it's python-inspired. Some notable differences are:
- no return keyword
- match/if are expressions
- it's functional
- =? is used for early returns or binding, depending on the variant of an Option or Result that is returned
There's a lot of other differences -- it's a smaller language surface than Python overall.
This is in the very first example you see on the site. If it's a mistake, that's not encouraging. If this is actually how the language works, that's even less encouraging -- the syntax highlighter doesn't even get it right!
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.
21 comments
[ 3.2 ms ] story [ 54.9 ms ] threadPerhaps it's just one point from me - not liking chaining :D
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.
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.
And I don't quite understand the memory model, is it something similar to Rust?
For example, a typical web service I work on:
Currently I'm playing around with an idea for a language that makes writing things like that fast and compact to read. Something like: This is a synthetic example, but you get the idea (entitites and value objecst omitted here)What do you think? Does it make sense? It basically moves something usually implemented by a framework into the language, but that's the entire point: a language optimized for writing compact, architecturally safe stateless services in a few lines of code. For example, since we know a request's memory is bound to that request (no global state), we can have very optimized memory management without a full GC => improved latency. Or for example, we can have compile-time checks for things like dependency direction validation (i.e. the domain layer cannot reference the infrastructure layer) to keep the architecture clean, etc.
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:
https://www.lehmans.com/product/striped-european-style-ferme...
Looks somewhat Python-like but modernised (great!) - is it indentation sensitive?
There's a lot of other differences -- it's a smaller language surface than Python overall.
I was trying to find if it is definitely a significant whitespace syntax, as it appears to be
This is in the very first example you see on the site. If it's a mistake, that's not encouraging. If this is actually how the language works, that's even less encouraging -- the syntax highlighter doesn't even get it right!
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.