~ntietz/lilac-lang

an experimental programming language

d677c24 Add shorthand for Option as well

3 months ago

8cf5de3 more syntax

3 months ago

#Lilac

Lilac is a project by Nicole to create a language that is nice to use, but mostly to learn a lot along the way.

#Design goals

This is a brain dump of design goals for Lilac:

  • Language:
    • Imports
    • Comments
    • Built-in types
      • numbers (float types, int types, bigint)
      • booleans
      • strings
      • lists
      • structs
      • tuples (with arity as part of type)
      • sets
      • (hash)maps
      • functions (named or anonymous)
      • references
    • Built-in functions
      • print(...) (and friends)
      • log(...) (and friends)
    • Tracing
    • Pattern matching
    • Explicit return statements
    • Static types
      • Algebraic data types
      • Immutable by default, explicit mutability
      • Type inference
    • Support for different memory layouts by the compiler ala data oriented programmingts by the compiler ala data oriented programmjng
  • Runtime:
    • Interpreted with a byte code interpreter, and allow decoupling compiling from interpreting
      • Homegrown interpreter
      • WASM target
    • Easy concurrency and distribution
      • Autotuning of parallel levels
      • How much safety can/should we try to give the programmer here?
    • Reference counting garbage collector
    • Performance checks: built-in tracing, CPU profiling, memory profiling
  • Other:
    • Syntax highlighting
    • Web playground
    • Package manager
    • "Free" FFI with Rust

#Timeline

There's no planned timeline. If this is done before 2030, I'll be happy. If I can use it for Advent of Code in 2024, I'll consider it a wild success.

#Contributions

Pairing is welcome, so if you want to collaborate, reach out. Other contributions will be kindly declined for now.

#License

Lilac is licensed under either the AGPL-3.0 or the GAL-1.0, whichever strikes your fancy. You may use it under the terms of either license. Be gay, do crime.

#Resources

Some design resources for inspiration.

#Bytecode ideas

Look at these for ideas: