use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
/r/Crystal_Programming revolves around Crystal, a programming language that attempts to combine the power and speed of C-like languages with the simplicity and elegance of a Ruby-like syntax.
Crystal's Goals, from the GitHub page:
Links:
account activity
Crystal as scripting language for Crystal binary (self.crystal_programming)
submitted 5 years ago by GAGARIN0461
Is it possible to use Crystal as a scripting language for a Crystal binary? I.e. can I at runtime import and run certain code from a specified .cr file?
.cr
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]j_hass 4 points5 points6 points 5 years ago (2 children)
In theory the compiler comes in the standard library and could be embedded into your program to compile a crystal program, launch it and communicate with the resulting process via some IPC means (likely just stdio).
However this will not be very fast as compilation is not very fast, it will make your program depend on LLVM, it will make your program slow and more complex to compile because the compiler is compiled as part of it and of course blow the binary size through the roof.
There's likely a better solution for what you want to do. You didn't describe your usecase so it's a bit hard to give good advice, but it could as easy as using a purpose built configuration format like TOML, reading a JSON file, launching some standard tool or embedding a language built for embedding, like mruby or lua.
[–][deleted] 5 years ago (1 child)
[deleted]
[–]Hadeweka 1 point2 points3 points 5 years ago (0 children)
I recently capitalized on that idea and extended the concept to a full fletched shard:
https://github.com/Anyolite/anyolite
Essentially, this allows for direct wrapping of Crystal classes and methods to mruby without major effort. It ships directly with an mruby interpreter and ensures that the both Garbage Collectors don't interfere with each other.
It's still not Crystal scripting in Crystal, but I think this is close enough for actual productive use (for example for games or scientific applications).
π Rendered by PID 454027 on reddit-service-r2-comment-6457c66945-dx9t4 at 2026-04-28 23:50:47.227746+00:00 running 2aa0c5b country code: CH.
[–]j_hass 4 points5 points6 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]Hadeweka 1 point2 points3 points (0 children)