Replies: 2 comments 1 reply
-
Hello! I believe Nickel would be quite fitting for such a task - in fact I've talked with other people experimenting with the same ideas (use Nickel as a "typed workflow" description language). We also wrote the interpreter in Rust in part to make it easy to interface with other languages (although, as of now, we don't expose C bindings yet, but at least here's no runtime in the way 🙂 ), so it shouldn't be too hard to embed. I believe the merging approach of Nickel can lead to new and interesting programming techniques for some domains, that haven't been really explored yet. First, the elephant in the room is that Nickel is just less mature than a language like Lua. It's been in development for years, and past 1.0, so it shouldn't be totally unstable, but it's still nowhere as tested. A second possible drawback could be performance. Lua has very, very fast engines available, and is a much simpler language. Nickel, on the other hand, have had performance problems already for mid sized codebase - although it's not really something Nickel-specific, but rather than we invested in other aspects of language engineering before performance. The good news is that we're working on it right now (see e.g. #1622), and already started implementing optimizations. Still, I think we have some serious work to compete with modern, efficient scripting VM or JIT compilers. I would say it depends on the nature what you're trying to do: is it a more experimental project? Do you anticipate manipulating data structures (say, array) of typical size 10,100,1k,10k,100k,1M elements? Do you expect scripts to stay small or to grow larger? Is the Nickel evaluation part going to be potentially a non-negligible part of the whole thing? |
Beta Was this translation helpful? Give feedback.
-
Related question: if I do want to have IO and side-effects, how would that look in nickel? Context: suppose we ignore all existing prior art whatsoever, and decide to implement something of the same overall shape as However, one also needs some executable language to describe build function of the derivation itself. In nix currently, that is bash. So, you derivation build function is roughly the following bash script ./configure
make
make install It is very tempting to get rid of this second language (bash) and just use nickel for building stuff as well. How bad |
Beta Was this translation helpful? Give feedback.
-
I was thinking of embedding Nickel in a project of mine as a scripting language (think spreadsheet formulas or workflow automation). Usually Lua would be a good fit for something like this I guess, but I'd prefer the Nickel syntax a lot. Also I can probably do without IO functions like network- and file-access.
Are there any drawbacks / concerns I should be aware of?
Beta Was this translation helpful? Give feedback.
All reactions