These are chat archives for ChaiScript/ChaiScript

Jan 2018
Jan 07 2018 17:46
I have an absolutely absurd question. I currently use JS, Python and C++ at work and I often end up writing the same code in each. I'm looking for something to ease my pain. I can't take JS code and convert it, I could likely take python and convert that to JS, but then C++ is the issue. Since C++ is the most strongly typed language, it seems that it would win, however the parsing would be absurd. Chai seems to be ideally positioned such that it's simple syntax, supported for C++, can be shared with python, leaving only JS an issue, but source translation could be an option.
Would it be possible to have Chai generate valid code for Python and JS? I realize there are a lot of downstream issues - like libraries, asyncs, etc. But could the Chai AST be used to generate code for other languages?
Jason Turner
Jan 07 2018 18:00
Probably. I've considered the possibility of having the AST generate C++ code so that Chai would be used as a prototyping language for C++
Jan 07 2018 18:03
That would be really cool. Even if it is not entirely "practical" for me, but I think it could end up being a better than .NET or JAVA thing (/me ducks) because eventually you could have the same libraries and master chai code for all platforms. Maybe adding a few syntax rules could also extend to Ruby, et al.
But for my immediate purposes, being able to write the same basic class in POD types for all three languages would accomplish what I am am after
Currently I have to make sure each implementation has the same behavior. Which is difficult when you're using node's csv-parse and python's csv module on the same project
If I could only write one "chiabrary"
Jan 07 2018 18:17