DEV Community

Discussion on: May 1 — Daily CodeNewbie Check-in Thread

Collapse
 
vonheikemen profile image
Heiker

So I begin another side project. I want to create a C-like language that compiles to a "portable shell script syntax".

The idea is to write something like this.

if @str.equal(somedata, "stuff") {
  grep("mystring", "/tmp/myfile")
  echo("what?")
  npm("init") . force . quiet
}

Then transform that into a shell script.

if [ "$somedata" = "stuff" ]
then
  grep "mystring" "/tmp/myfile"
  echo "what?"
  npm "init" -y > /dev/null 2>&1
fi

Still trying to figure out the grammar. The good news is that discovered this thing that takes care of the AST stuff and let's me try out different things quickly.

Anyway, that should keep me busy for a while.