Live data from Hacker News

Show HN: Cicada – A scripting language that integrates with C

github.com

1–10 of 41 posts

Show HN: Cicada – A scripting language that integrates with C

#1
I wrote a lightweight scripting language that runs together with C. Specifically, it's a C library, you run it through a C function call, and it can callback your own C functions. Compiles to ~250 kB. No dependencies beyond the C standard library.

Key language features: * Uses aliases not pointers, so it's memory-safe * Arrays are N-dimensional and resizable * Runs scripts or its own 'shell' * Error trapping * Methods, inheritance, etc. * Customizable syntax

Show HN: Cicada – A scripting language that integrates with C
github.com

Re: Show HN: Cicada – A scripting language that integrates with C

#2
Cool, I like these kinds of projects. When it comes to embedding a scripting language in C, there are already some excellent options: Notable ones are Janet, Guile, and Lua. Tcl is also worth considering. My personal favorite is still Janet[0]. Others?

[0]: https://janet-lang.org/

Re: Show HN: Cicada – A scripting language that integrates with C

#3
post #2

Cool, I like these kinds of projects. When it comes to embedding a scripting language in C, there are already some excellent options: Notable ones are Janet, Guile, and Lua. Tcl is also worth considering. My personal favorite is still Janet[0]. Others? [0]: https://janet-lang.org/

Io is nice (Smalltalk/Self-like). A mostly comprehensive list: https://dbohdan.github.io/embedded-scripting-languages/

Re: Show HN: Cicada – A scripting language that integrates with C

#5
Thanks for the references! Writing a language was almost an accident — I worked on a neural networks tool with a scripted interface back around 2000, before I’d ever heard of some of these other languages.. and I’ve been using/updating it ever since.

Beyond NNs, my use case to embed fast C calculations into the language to make scientific programming easier. But the inspiration was less about the use case and more about certain programming innovations which I’m sure are elsewhere but I’m not sure where — like aliases, callable function arguments, generalized inheritance, etc.

That’s a great list — most of those languages I’ve honestly never heard of..

Re: Show HN: Cicada – A scripting language that integrates with C

#6
post #4

What's the use case? Clearly, you made it with some specific use in mind, at least initially. What was it?

To be more specific (see my general comment), I’ve used the language in two open-source projects: 1) a chromosome conformation reconstruction tool, and 2) a fast neural network generator (back end). Re Project 2: I’m also planning to embed the language into results webpages served from the NN generator website.

Re: Show HN: Cicada – A scripting language that integrates with C

#7
post #2

Cool, I like these kinds of projects. When it comes to embedding a scripting language in C, there are already some excellent options: Notable ones are Janet, Guile, and Lua. Tcl is also worth considering. My personal favorite is still Janet[0]. Others? [0]: https://janet-lang.org/

Io is nice (Smalltalk/Self-like). A mostly comprehensive list: https://dbohdan.github.io/embedded-scripting-languages/

Should have replied directly —- thanks! That’s a great list..

Re: Show HN: Cicada – A scripting language that integrates with C

#9
post #2

Cool, I like these kinds of projects. When it comes to embedding a scripting language in C, there are already some excellent options: Notable ones are Janet, Guile, and Lua. Tcl is also worth considering. My personal favorite is still Janet[0]. Others? [0]: https://janet-lang.org/

Thanks! I’m unfamiliar with Janet but I’ve looked into the others you listed.

One personal preference is that a scripting syntax be somewhat ‘C-like’.. which might recommend a straight C embedded implementation although I think that makes some compromises.

Post reply on HN