summaryrefslogtreecommitdiff
path: root/doc/goals.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/goals.txt')
-rw-r--r--doc/goals.txt52
1 files changed, 40 insertions, 12 deletions
diff --git a/doc/goals.txt b/doc/goals.txt
index 620438c..5ce3473 100644
--- a/doc/goals.txt
+++ b/doc/goals.txt
@@ -1,4 +1,13 @@
-a loose collection of goals and ideas for this as-yet-unnamed language
+a loose collection of goals and ideas for this as-yet-unnamed language. the
+main goal is really just (a) to have fun, and (b) to make a c replacement that
+provides the things i personally wish the language was better on.
+
+* very small, self-contained executables
+ + hello world should ideally be on the order of a couple kilobytes
+ + only functions which get referenced from main (and so on recursively)
+ get any code generated, even for the stdlib
+ + favor size over performance where reasonable
+ + effectively no language runtime
* fast compilation
+ grammar must be very easy to parse
@@ -8,12 +17,6 @@ a loose collection of goals and ideas for this as-yet-unnamed language
+ in general:
- the most important thing for coding to be fun is a tight feedback loop
-* very small, self-contained executables
- + hello world should ideally be on the order of a couple kilobytes
- + only functions which get referenced from main (and so on recursively)
- get any code generated, even for the stdlib
- + favor size over performance where reasonable
-
* explicit
+ procedures that allocate should have an arena parameter
+ no operator overloading, but builtin vector/matrix types (eventually)
@@ -41,22 +44,47 @@ a loose collection of goals and ideas for this as-yet-unnamed language
- let x = y
- can do like .ENUM_NAME when expecting an enum value, even though
otherwise it's `let x = EnumType.ENUM_NAME`
+ + pascal-style postfix dereference, no need for a->b or (*a).b
+ - possibly also auto-dereference when accessing fields
* c interop
+ + c type aliases in stdlib
+ + can turn off name mangling on exported identifiers
+ ability to specify different calling conventions on:
- functions imported from outside
- functions exported
-* types and procedures in any order
- + this goal can be thrown out if it turns out to slow down the compiler
- - but finding these first allows to hand all procedures to a thread pool
- for parsing and optimization
- + removes the need for function prototypes, opaque structs, etc.
+* better module system than c
+ + proper module import, no header files
+ + types and procedures in any order
+ - can be thrown out if it turns out to slow down the compiler, but
+ finding these first allows to hand all procedures to a thread pool for
+ parsing and optimization
+ - removes the need for function prototypes, opaque structs, etc.
+ like in odin, all files in a directory are compiled together and have
the same toplevel scope; to isolate things in a package, put them in
a different directory
+ + no A::B like in c++ or rust, just a normal A.B
* portable
+ should be as easy as possible (like that's saying much...) to port to new platforms
+ at minimum support amd64 and wasm
+ - try and make it work with windows
+ consider having a version of the compiler which uses LLVM for release builds
+
+* useful
+ + not just a toy language!
+ + begin dogfooding with it as soon as that's viable
+ + write a text editor, develop the compiler with that
+ + eventually bootstrap into a self-hosting one, maybe
+ + utility procedures in the standard library
+ - string manipulation: searching, splitting, comparing, etc.
+ - utf8 encoding & decoding
+ - libc bindings
+ - command-line argument parsing
+ - consistent allocator interface
+ - arena allocators
+ - memory context allocator (like c# autorelease pool)
+ - file i/o, can read whole thing into string easily
+ + try to get _reasonable_ levels of optimization, within the constraints of
+ simplicity and very fast compilation