SCLPL Design Notes
Language Requirements:
- Eager Evaluation
- Single Assignment
- Dynamic Typing
- Immuatable Data Structures
- Functional Programming
- Garbage Collection
- Tail Call Optimization
- Compiled to native binaries
- no virtual machine, C as target language
- First class parallelism/concurrency
- First class support for testing
General Info
- Erlang
- wikipedia
- Error handling
- Actor model, message passing
- Stack growing/recursion story
- Go Stack Handling
- Apple Docs/Source
Concurrency/Parallelism
- Processes
- Threads
- Tasks (coroutines)
- Communicating Sequential Processes
- Actor Model
Investigations
- makecontext/setcontext based coroutines
- raw assembly coroutines based on fcontext_t
- CSP versus Actor model
Language Design
Ideas to Explore
- Expression-only Syntax
- Assignment operator is the only way to define variables and can be, but should not be, used as an expression.
- The entire grammar (almost) is parsed with a Pratt parser.
- Gradually typed type system
- Dynamically typed in absence of annotations
- Annotations allow the compiler to utilize unchecked operations for higher performance
- Typing would be bidirectional to allow for types to be inferred from values or bindings.
- Would allow for unannotated expressions that are still provably safe to utilize unchecked operations
- Deferred reference counting for garbage collection.
- Immutable bindings and data so no cycles to deal with.
- Could use non-atomic increment/decrement and use multiprocessing instead of multithreading.
Atomic Types
- Fixnums
- Flonums
- Strings
- Symbols
Aggregate Types
- Lists
- Vectors
- Maps
- Records/Tuples?
Other Types
- Ports
- Procedures/Closures/Functions