Skip to content

masroof-maindak/nuktah

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nuktah

Banner

Nuktah is a programming language. It is quite possibly the most based one to ever exist. Here's what a sample looks like:

fn ginti some_fn() {
	duhrao (ginti a = 0 . a < 10 . a = a + 1) {
		agar (a == 5) { toro } warna {}
	}

	wapsi 5 .
} .

Installation & Usage

  • The shrimplest way to get up and running with the Nuktah compiler is downloading an automatically generated release (x86_64 Linux only)
  • To build locally, ensure you have cargo and rust installed and added to your $PATH
git clone https://github.com/masroof-maindak/nuktah.git
cd nuktah
cargo build -r
./target/release/nktc <src.nkt>

TODO

  • Support for comments
  • Fix string literal tokenization
  • Add UTF8 support for language; deprecate use of bytes
  • Convert concrete syntax tree to AST
  • AST pretty-printing
  • Transliterated Urdu keywords
  • Lexer: Combine T_INT T_DOT T_INT to T_FLOAT
  • Break keyword - toro
  • Allow empty expressions so duhrao (..) is valid
  • Void type - khali
  • Scope Analyser
    • SpaghettiStack skeleton
    • Analyse declarations
    • Analyse blocks
    • Analyse for/if
    • Analyse PrimaryExpr::Ident
    • Iterate up stack - parent 'climbing'? -> store Ids rather than references
  • Refactor into separate sub-modules
  • CI/CD -> Build/Release
  • Use macros for error conversions
  • Type-checker
    • Store whether symbol belongs to var/func in symbol table
    • Store type of scope in ScopeMap
    • Variable declarations -> Literals' type == token type
    • Function definitions -> return type == token type
    • Function to get id of nth scope-type child, of a given node
    • Type-checking of for/if
    • Recursive-descent expression chain
    • Type-check arguments to functions
  • bug: void type semantic analysis
  • bug: parsing of string declarations
  • Add a boolean type
  • Eliminate mod.rs files
  • Unit tests
  • ir_gen
  • asm_gen -> ARM? MIPS?
  • Arrays
  • Structs
  • Rewrite expression printing rules (for the AST) w/ macros
  • Eliminate Rust anti-pattern: String cloning w.r.t Token::StringLit

Acknowledgements

Parsing

About

Compiler for the Nuktah programming language.

Topics

Resources

License

Stars

Watchers

Forks