Urgent.News

What's breaking now, across thousands of outlets.

Tech

Micro language implementation: Calcium

I have developed a small programming language called Calcium. This language exemplifies the inner workings of languages similar to Python. The Calcium language incorporates key features such as a tokenizer, parser, abstract syntax tree (AST), compiler, bytecodes, and an execution engine, all contained within approximately 300 lines of code.

My motivation behind this project stems from frequently encountering the query: "Isn't Python interpreted? Why do people claim it's compiled?" (For reference, I have previously addressed this topic in my blog post: "Is Python interpreted or compiled? Yes.") To effectively communicate that Python programs do not transform into explicit sequences of native CPU instructions, a common misconception associated with the term "compiled," I created Calcium.

This implementation serves as a valuable reference when this question arises in the future. Additionally, Calcium can serve as an intriguing starting point for individuals interested in experimenting with language implementations. Its simplicity allows for easy modification and enhancement, offering a wealth of opportunities to add more functionalities and improve upon the existing design.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at nedbatchelder.com →

More in Tech

Ten Great DevOps Job Opportunities

DevOps.com is now providing a weekly DevOps jobs report through which opportunities for DevOps professionals will be highlighted as part of an effort to better serve our audience.

What does "verified" actually mean in your stack?

I have started thinking the most dangerous word in a codebase is a field called verified . Because it usually means one of two completely different things, and they get stored in the same column.

  • "Verified" can mean cryptographic signature proven true through math
  • "Verified" can also mean inferred or estimated judgement by heuristics
  • Using separate fields for each type of "verified" reduces errors

More from Monday 24 August →