Crux is a principled, practical language that aims to provide an easy, familiar programming environment that does not compromise on rock-solid fundamentals.
Crux is all about small, well-understood ideas that fit together without clumsy seams or weird corner cases.
We won't try to guess what you're trying to say because we don't think your customers should be the ones to tell you that we guessed wrong.
Our intent with Crux is to capture
fun getFolderContents(folder) {
let rv = []
let contents: Array String = fs.readdirSync(folder)
for entry in contents {
let absEntry = combine(folder, entry)
let stat = fs.lstatSync(absEntry)
if stat.isFile() && (entry->endsWith(".jpeg") || entry->endsWith(".jpg")) {
rv->append(entry)
}
}
return rv
}
Working:
if-then-else
return
, break
, continue
Partially done:
Not done:
The Crux compiler is a Haskell program, but you don't need to be a Haskell programmer to build or use it.
If you're familiar with building Haskell software, we expect the compiler to build either with cabal or stack.
If not, read on:
git clone https://github.com/cruxlang/crux
cd crux
stack install
This will build crux and install it to ~/.local/bin/crux
.
Main.hs is the general command-line interface.
Look at Module.hs and Project.hs for the code to load modules and projects.