> Lil has a soft, spongy, dynamic type system in which values do their best to convert to a more relevant type as the need arises. Noooooo, this is a terrible idea if you want this to be used at any non-trivial scale
Triviality is in the eye of the beholder, but I consider this the correct choice for the application. I've already registered my one objection, but don't mind expanding on why I think this is a good idea. Lil is designed for an interesting, if a bit retro, reboot of HyperCard. The fantastic thing about HyperCard was the ability for a user to just... change stuff. In a HyperCard system, users become developers wheneve…
Lil: A Scripting Language
11–20 of 29 posts
Re: Lil: A Scripting Language
#12I see the query language goes: `select ... from`
One thing I like about query languages that start with the "from" class is that then it's easier in REPLs to provide suggestions for what can be selected.
You type, say, `from people` and you can get a suggestion for `name`.
Re: Lil: A Scripting Language
#13The 'soft, spongy' type system is nice to see. That kind of strong dynamism is a good choice for the application: it will do the wrong thing sometimes, but will throw fewer show-stopping errors, which are really disheartening for casuals. I do regard casting not-numbers to 0 as a flaw. I've had plenty of bugs where I wished `nil` would automatically cast to to `""` in string position, or the empty list/dict: but I ha…
This is really task/domain-dependent. It's convenient in shell scripts and AWK, but in bigger programs it really isn't good. One of the things I love about Python is that its type system is actually quite strong , in that implicit conversion is very rare in the standard library and somewhat frowned upon in general. Having "falsy" and "truthy" values that are not actually `bool` instances is maybe the only big excepti…
Lisps are a good example of using emptiness well, I wouldn't want an empty Lua table to be false, but you can't do classic Lisp programming without a falsy empty list, I wouldn't have it any other way. Large Lisp programs have their problems but it isn't the empty list causing those.
I wouldn't want to use Lil for the things I use Lua for. I think it's a great match for what Decker is doing here.
Re: Lil: A Scripting Language
#14Nice. The embedded querying is neat. I see the query language goes: `select ... from` One thing I like about query languages that start with the "from" class is that then it's easier in REPLs to provide suggestions for what can be selected. You type, say, `from people` and you can get a suggestion for `name`.
Re: Lil: A Scripting Language
#15> Lil has a soft, spongy, dynamic type system in which values do their best to convert to a more relevant type as the need arises. Noooooo, this is a terrible idea if you want this to be used at any non-trivial scale
Triviality is in the eye of the beholder, but I consider this the correct choice for the application. I've already registered my one objection, but don't mind expanding on why I think this is a good idea. Lil is designed for an interesting, if a bit retro, reboot of HyperCard. The fantastic thing about HyperCard was the ability for a user to just... change stuff. In a HyperCard system, users become developers wheneve…
Perhaps have a switch that can enables stronger type checking.
Re: Lil: A Scripting Language
#16The 'soft, spongy' type system is nice to see. That kind of strong dynamism is a good choice for the application: it will do the wrong thing sometimes, but will throw fewer show-stopping errors, which are really disheartening for casuals. I do regard casting not-numbers to 0 as a flaw. I've had plenty of bugs where I wished `nil` would automatically cast to to `""` in string position, or the empty list/dict: but I ha…
This is really task/domain-dependent. It's convenient in shell scripts and AWK, but in bigger programs it really isn't good. One of the things I love about Python is that its type system is actually quite strong , in that implicit conversion is very rare in the standard library and somewhat frowned upon in general. Having "falsy" and "truthy" values that are not actually `bool` instances is maybe the only big excepti…
I would not want to use a language with a spongy type system for any code I'm distributing to other people But for quick one-off scripts that only I will use, it is quite convenient.
Re: Lil: A Scripting Language
#17Earlier quoted context omitted.
This is a very domain-specific language, not designed to be used at a nontrivial scale. I think it's a good idea in this context.
Unfortunately, the fact that a system is not designed to be used at a nontrivial scale is no guarantee that it won't be used that way. For instance, there are a lot of Excel worksheets doing things I am sure the designers of Excel never expected Excel to have to do.
Re: Lil: A Scripting Language
#18Earlier quoted context omitted.
This is really task/domain-dependent. It's convenient in shell scripts and AWK, but in bigger programs it really isn't good. One of the things I love about Python is that its type system is actually quite strong , in that implicit conversion is very rare in the standard library and somewhat frowned upon in general. Having "falsy" and "truthy" values that are not actually `bool` instances is maybe the only big excepti…
Definitely. I would argue even in shell scripts it's not always great. Just thinking about all those times rm -rf "~/${configdir}" accidentally wiped someone's home directory because that unset variable was implicitly turned into an empty string, etc. I would not want to use a language with a spongy type system for any code I'm distributing to other people But for quick one-off scripts that only I will use, it is qui…
test ! "${configdir}"||rm -rf "~/${configdir}"
[ "${configdir}" ]&&rm -rf "~/${configdir}"
test x"${configdir}" = x""||rm -rf "~/${configdir}"
[ x"${configdir}" != x"" ]&&rm -rf "~/${configdir}"
This assumes NetBSD ash or Debian ash which is what I use. I write scripts for me, not for others and often end up using "quick one-off" scripts for years. After decades of using UNIX, I have never wiped a root directory accidentally (but there is still time). YMMV.Re: Lil: A Scripting Language
#19Earlier quoted context omitted.
Definitely. I would argue even in shell scripts it's not always great. Just thinking about all those times rm -rf "~/${configdir}" accidentally wiped someone's home directory because that unset variable was implicitly turned into an empty string, etc. I would not want to use a language with a spongy type system for any code I'm distributing to other people But for quick one-off scripts that only I will use, it is qui…
test ! "${configdir}"||rm -rf "~/${configdir}" [ "${configdir}" ]&&rm -rf "~/${configdir}" test x"${configdir}" = x""||rm -rf "~/${configdir}" [ x"${configdir}" != x"" ]&&rm -rf "~/${configdir}" This assumes NetBSD ash or Debian ash which is what I use. I write scripts for me, not for others and often end up using "quick one-off" scripts for years. After decades of using UNIX, I have never wiped a root directory acci…
You can also set the "-u" option (in Zsh, `setopt no_unset`) which at least will cause your script to crash with an error if you happen to forget this check. But then you have to remember to set that option as well!
Lua has a similar-ish problem with undefined variables being `nil`, but for the most part Lua is also rather strictly typed, and that will typically end up causing some kind of error deep inside a function call, rather than doing something dangerous silently.
Re: Lil: A Scripting Language
#20Nice. The embedded querying is neat. I see the query language goes: `select ... from` One thing I like about query languages that start with the "from" class is that then it's easier in REPLs to provide suggestions for what can be selected. You type, say, `from people` and you can get a suggestion for `name`.
Having written an sql parser, I very very strongly agree.
Typical argument for the "From table select column" are due to better matching evaluation logic and improving type-ahead suggestions in IDE's, but I haven't yet heard the argument that it also makes parsing simpler.