Stack-based programming language which emulates the look and feel of the 60s

Overview

Cauchemar

Cauchemar is a stack-based programming language inspired by FORTH but more arcane.

  • Emulates the look and feel of a programming language from the 60s to early 70s.
  • Lacks variables and registers.
  • Single global stack which stores 32-bit integers, booleans, and string.
  • No side-effects, can only print values to a terminal.
  • No Read-Eval-Print-Loop.
PROGRAM:
  "Hello, world!" PRINT       /* Display "Hello, world!"                */
  16 32 + 4 2 * /             /* Calculate (16 + 32) / (4 * 2)          */
  DUP PRINT                   /* Print the result                       */
  DUP 6 EQUALS ASSERT         /* Validate the result                    */
  PLUS-FORTY-TWO              /* Call routine "PLUS-FORTY-TWO"          */
  
  DUP 50 GREATER-THAN         /* Check if the result is greater than 50 */
  IF   "This is wrong" PRINT
  ELSE "This is right" PRINT
  THEN
  
  DO 1 -                      /* Count down to 0                        */
     DUP PRINT 
     DUP 0 GREATER-THAN 
  WHILE
  
  DROP                        /* Reject the top of the stack            */
    
  
PLUS-FORTY-TWO:
  42 +                        /* Add 42 to the top of the stack         */

Planned features

  • Performance improvements
  • Registers to store values outside of the stack
  • Backtrace on panic
  • Human-readable parser errors
  • Terminal input
  • More standard routines
    • Math routines
    • String routines
    • Stack manipulation routines
    • Terminal IO routines
  • Interactive session
    • Not an REPL, step through each commands while inspecting the internal VM state.
    • Hopefully runs within the web browser for accessibility.

Frequently Asked Questions (F.A.Q)

Why did you make this?

This programming language came from my dreams and it left a mark on me.

I thought it would be funny to make a real.

At the same time, I feel like it's quite interesting to explore a stack-based programming language and roleplay as if we're in some "false-past" of early computing, akin to the world building you find in Zachtronics games.

Today, stack-based computing takes a more background role as they're still widely-used as the basis of many virtual machines for a garden variety of programming languages or computing environments (i.e. WebAssembly, JVM, CPython, CLR).

What does the name mean?

"Cauchemar" is the French word for "Nightmare" which is the origin of the programming language.

Can I use this on production?

No, that's silly.

You might also like...
An embedded key-value storage for learning purpose, which is based on the idea of SSTable / LSM-tree.

Nouzdb An embedded key-value storage for learning purpose, which is based on the idea of SSTable / LSM-tree. Plan Implement a memtable. Implement the

A rocksdb.rs wrapper bringing stack and queue functionalities

RocksDB_sq (Stack & Queue) A Rust crate that adds stack and queue functionality to RocksDB. This crate provide a wrapper around a RocksDB database and

Orion lang is a lispy programming language that is strongly and statically typed.
Orion lang is a lispy programming language that is strongly and statically typed.

Orion Orion is a lisp inspired statically typed programming language written in Rust Install To install orion you can either: Download binary from the

Mote is a systems-programming language designed to be practical, performant, and simple.
Mote is a systems-programming language designed to be practical, performant, and simple.

Mote NOTE: this following lists the goals for what Mote is supposed to be. It does not promise that any of the features here will be accomplished or a

lints and suggestions for the nix programming language

statix Lints and suggestions for the Nix programming language. statix highlights antipatterns in Nix code. statix --fix can fix several such occurrenc

A turing-complete programming language using only zero-width unicode characters, inspired by brainfuck and whitespace.

Zero-Width A turing-complete programming language using only zero-width unicode characters, inspired by brainfuck and whitespace. Currently a (possibl

A simple programming language for something between C and Rust.

inuc inuc is a systems programming language that is something between C and Rust. Features : [] Strong , static typing (type inference not a priority

🐱 A high-speed JIT programming language and its runtime, meow~

🐱 A high-speed JIT programming language and its runtime, meow~

A statically-typed, interpreted programming language, with generics and type inference

Glide A programming language. Currently, this includes: Static typing Generics, with monomorphization Type inference on function calls func identityT

Owner
Yuki Langley
🧙 Your friendly neighborhood hacker. Good luck, fellow traveler 💫 they/them
Yuki Langley
OOLANG - an esoteric stack-based programming language where all instructions/commands are differnet unicode O characters

OOLANG is an esoteric stack-based programming language where all instructions/commands are differnet unicode O characters

RNM Enterprises 2 Mar 20, 2022
The Devils' Programming Language (Quantum Programming Language)

devilslang has roots in Scheme and ML-flavored languages: it's the culmination of everything I expect from a programming language, including the desire to keep everything as minimalistic and concise as possible. At its core, devilslang is lambda-calculus with pattern-matching, structural types, fiber-based concurrency, and syntactic extension.

Devils' Language 2 Aug 26, 2022
A stack based, virtual machine language written in Rust

Stackyy A stack based, virtual machine language written in Rust Description: Stackyy is a stack based, virtual machine language inspired by Forth and

FlawlessCode 2 May 2, 2022
lelang programming language is a toy language based on LLVM.

lelang leang是一门使用Rust编写,基于LLVM(inkwell llvm safe binding library)实现的编程语言,起初作为课程实验项目,现在为个人长期维护项目。 Target Features 支持8至64位的整形类型和32/64位浮点 基本的函数定义,调用,声明外部

Aya0wind 5 Sep 4, 2022
Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.

Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.

co-rs 47 Nov 17, 2022
A repository for showcasing my knowledge of the Rust programming language, and continuing to learn the language.

Learning Rust I started learning the Rust programming language before using GitHub, but increased its usage afterwards. I have found it to be a fast a

Sean P. Myrick V19.1.7.2 2 Nov 8, 2022
Nyah is a programming language runtime built for high performance and comes with a scripting language.

?? Nyah ( Unfinished ) Nyah is a programming language runtime built for high performance and comes with a scripting language. ??️ Status Nyah is not c

Stacker 3 Mar 6, 2022
An MVP stack based bytecode VM

TinyVM An MVP stack-based bytecode VM This VM runs a simplistic, Turing complete instruction set. In ~250 LOC with extensive comments, it's meant to b

Mikail Khan 77 Dec 27, 2022
A simplistic functional programming language based around Lisp syntax.

Orchid A simplistic functional programming language based around Lisp syntax. Short taste # function to return the larger list (fn larger-list (as bs)

rem 3 May 7, 2022
ArbOS operating system, to run at Layer 2 on Arbitrum chains. Also a compiler for Mini, the language in which ArbOS is written.

ArbOS and Mini compiler ArbOS is the "operating system" that runs at Layer 2 on an Arbitrum chain, to manage the chain's operation, maintain security,

Offchain Labs 88 Nov 6, 2022