For contrast, here's how I'd handle the example given on the front page in Lil[0]:
i:"%j" parse shell["curl -s https://api.weather.gov/gridpoints/BOU/63,62/forecast"].out
t:i.properties.periods..temperature
o.average:(sum t)/count t
o.minimum:min t
o.maximum:max t
show[o]
Lil doesn't have implicit parsing of .json arguments like Blots- certainly a nice feature for the niche Blots is aimed at. Lil also doesn't have an arithmetic average as a builtin like Blots, but in this case it's easy enough to do without.
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.
Good question! Personally, I don't often reach for jq as I've never really taken the time to get comfortable with its syntax. Obviously I can now have an LLM generate me a jq command that'll do what I want, but I'd prefer to be able to at least visually scan the suggested implementation to make sure it actually does the thing I want before I go and run it.
More broadly, a lot of other command line utils for transforming input have such an emphasis on terseness that I sort of bounce off of them. awk and sed and jq are all super powerful tools, but I wanted a tool that had a more balanced trade-off of characters vs. clarity.
nowadays it is somewhat easier to make your own programming language, than it was 10 to 20 or 30 years ago, because there are a lot of resources such as tutorials and open source projects available on the internet, in both text and video formats, to learn from. there are also many online forums where you can ask questions and get answers and advice.
For contrast, here's how I'd handle the example given on the front page in Lil[0]:
Lil doesn't have implicit parsing of .json arguments like Blots- certainly a nice feature for the niche Blots is aimed at. Lil also doesn't have an arithmetic average as a builtin like Blots, but in this case it's easy enough to do without.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
wow that sql like code is really impressive
Lil is such a beautiful language. It’s so much fun for little data tasks like this.
From the readme:
I guess most people would have expected that second expression to return Is this really more practical to single out booleans like that, compared to having a separate step for ANDing?What would you say is a benefit of using this over using jq?
Good question! Personally, I don't often reach for jq as I've never really taken the time to get comfortable with its syntax. Obviously I can now have an LLM generate me a jq command that'll do what I want, but I'd prefer to be able to at least visually scan the suggested implementation to make sure it actually does the thing I want before I go and run it.
More broadly, a lot of other command line utils for transforming input have such an emphasis on terseness that I sort of bounce off of them. awk and sed and jq are all super powerful tools, but I wanted a tool that had a more balanced trade-off of characters vs. clarity.
Super cool! I’ve always wanted to make my own lil language and I’ve always been too intimidated to try.
Start with writing a custom cpu emulator -> machine code -> assembler -> compiler
Sounds hard but it's quite easy with stack architecture :) Easier than learning JS for sure
nowadays it is somewhat easier to make your own programming language, than it was 10 to 20 or 30 years ago, because there are a lot of resources such as tutorials and open source projects available on the internet, in both text and video formats, to learn from. there are also many online forums where you can ask questions and get answers and advice.
I’m curious, what was the hardest part about making Blots? And what was the most fun part?
Blot on the landscape was a brilliant subversive comedy British TV series from the 80s.