Show HN: The Blots Programming Language (blots-lang.org)
I've been working on this small, slightly weird expression-oriented programming language for a little while now and feel ready to share it with others. I use it pretty often now in my day-to-day and work life, as a scratchpad for doing a bit of quick math or picking some pieces of data out of a JSON payload.
Would really appreciate any feedback about the syntax, docs, features that are glaringly missing, etc. Before anybody mentions it: I know the performance is pretty lousy when dealing with a lot of data. If you can believe it, the runtime is about 100x faster than it used to be! Long term I'd like to switch to a proper bytecode interpreter, but so far performance has been Good Enough for my use cases.
Thanks for taking a look!
10 comments
[ 3.7 ms ] story [ 36.2 ms ] threadSounds hard but it's quite easy with stack architecture :) Easier than learning JS for sure
The biggest difference here is how Lil handles indexing: The ".." in that second line can be read as "for every index"; a wildcard. I can follow the mapping that occurs in Blots' "via" expression, but I find it less clear in this example.
It can also be nice to treat lists-of-objects as proper SQL-like tables:
I hope you continue to tinker and evolve Blots; a personal scripting language guided by the use-cases you encounter naturally can be very rewarding and useful.[0] http://beyondloom.com/tools/trylil.html
``` [1, 2, 3] * 10 // [10, 20, 30] [10, 20, 30] + 2 // [12, 22, 32] [4, 5, 6] > 3 // [true, true, true] [1, 2] == [2, 2] // [false, true] ```
In addition, I’ve added both `all` and `any` as built-in functions. These can be used to achieve the same result as the previous broadcasting behavior:
``` [4, 5, 6] > 4 into all // false [4, 5, 6] > 4 into any // true
// alternatively: all([4, 5, 6] > 4) // false any([4, 5, 6] > 4) // true ```
Thanks for the feedback!