started laying out what needs to be done
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 10 Dec 2020 23:07:42 +0000 (17:07 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 10 Dec 2020 23:07:42 +0000 (17:07 -0600)
CHANGELOG
core/file.onyx
docs/todo [new file with mode: 0644]

index c6e364df03954a6c32d71d9a2a060a32415a4441..f9816a44d187839af46e7e40f29dce00294a09c3 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,15 @@
+Release v0.0.5
+--------------
+Additions:
+
+Removals:
+
+Changes:
+
+Bug fixes:
+
+
+
 Release v0.0.4
 --------------
 Additions:
index c107ddd8562eb9ed1241972c9819e2493d4f2a3c..0305ba7ccd3d1a4d55fc88f158db720015db120a 100644 (file)
@@ -22,15 +22,46 @@ open :: proc (file: ^File, path: string, mode := OpenMode.Read, flags := FDFlags
     DIR_FD :: 3;
 
     open_flags := cast(OFlags) 0;
-    rights := Rights.DataSync
-            | Rights.Sync
-            | Rights.FilestatGet
-            | Rights.FilestatSetSize
-            | Rights.FilestatSetTimes
-            | Rights.Advise
-            | Rights.Allocate
-            | Rights.PathOpen
-            | Rights.PathCreateFile;
+    // rights := Rights.DataSync
+    //         | Rights.Sync
+    //         | Rights.FilestatGet
+    //         | Rights.FilestatSetSize
+    //         | Rights.FilestatSetTimes
+    //         | Rights.Advise
+    //         | Rights.Allocate
+    //         | Rights.PathOpen
+    //         | Rights.PathCreateFile;
+            
+    rights :=
+        Rights.DataSync
+        | Rights.Read
+        | Rights.Seek
+        | Rights.FdStatSetFlags
+        | Rights.Sync
+        | Rights.Tell
+        | Rights.Write
+        | Rights.Advise
+        | Rights.Allocate
+        | Rights.PathCreateDirectory
+        | Rights.PathCreateFile
+        | Rights.PathLinkSource
+        | Rights.PathLinkTarget
+        | Rights.PathOpen
+        | Rights.ReadDir
+        | Rights.PathReadlink
+        | Rights.PathRenameSource
+        | Rights.PathRenameTarget
+        | Rights.PathFilestatGet
+        | Rights.PathFilestateSetSize
+        | Rights.PathFilestateSetTimes
+        | Rights.FilestatGet
+        | Rights.FilestatSetSize
+        | Rights.FilestatSetTimes
+        | Rights.PathSymlink
+        | Rights.PathRemoveDirectory
+        | Rights.PathUnlinkFile
+        | Rights.PollFDReadWrite;
+
     fdflags := flags;
 
     switch mode {
@@ -74,6 +105,13 @@ close :: proc (file: File) -> bool {
     return true;
 }
 
+write :: proc (file: File, data: string) {
+    vec := IOVec.{ buf = data.data, len = data.count };
+    tmp : Size;
+    fd_write(file.fd, IOVecArray.{ ^vec, 1 }, ^tmp);
+    fd_datasync(file.fd);
+}
+
 get_size :: proc (file: File) -> u64 {
     fs: FileStat;
     if fd_filestat_get(file.fd, ^fs) != Errno.Success do return 0;
diff --git a/docs/todo b/docs/todo
new file mode 100644 (file)
index 0000000..77bd674
--- /dev/null
+++ b/docs/todo
@@ -0,0 +1,56 @@
+Macro level tasks that need to be worked on:
+
+Command Line Interface:
+    Currently, the command line interface is trash. Pretty much the only thing
+    you can do is compile a binary file from a set of files. There are many
+    more things I would like to do with the CLI, including:
+        - Documentation generation in text, HTML, or man pages
+        - Add statistic printing (time taken, SLOC, etc)
+        - Abstract syntax tree printing
+        - Running the binary right away using Wasmtime, Wasmer or NodeJS
+
+    [ ] Remove old code from CLI logic
+    [ ] Fix documentation generation (broken since compiler architecture change) 
+    [ ] Add statistic printing
+    [ ] Fix AST printing (broken for a long time)
+    [ ] Add automated running component
+        - Store to temporary file (OS independent)
+        - Detect / choose WASM backend
+        - Run it
+        - Clean up
+
+Language Cohesion:
+    There are a couple areas of the language that have little gotchas because
+    of technical laziness. Cleaning up these areas will help the language feel
+    more cohesive and put together.
+
+    [ ] Struct literals can only have 1 level of package before the struct
+        name. This is because packages were not able to be nested, so having
+        arbitrary package levels before a struct literal was not necessary.
+        The following should work when this is patched:
+
+            var := some.packages.nested.here.StructName.{ value1, value2, ... };
+        
+    [ ] Rearrange APIs. There is a lot of functionality in the standard libraries,
+        but it isn't organized in a usable way.
+        - 'core.array' contains a lot of functionality that would also apply to
+          slices. 'core.slice' should contain this functionality and 'core.array'
+          can provide wrappers that convert the array to a slice.
+        - 'core.str' is a bad name, it should be 'core.string'. The issue is that
+          it conflicts with 'builtin.string'. These two should be switched. Type
+          name should be 'str' and package name should be 'string'
+
+    [ ] :: should not declare a local variable, just bind a name to an expression.
+        They can still be lexically scoped.
+
+    [ ] Currently accessing a field directly on a function call produces invalid
+        WASM code; i.e.  foo().bar; This should at least produce an error until
+        the underlying issue is fixed.
+
+Usability:
+    Currently, the compiler can only work on Linux. This is an arbitrary
+    restriction due completely to my laziness and lack of access to a
+    Windows / MacOS computer.
+
+    [ ] Make compiler work on Windows
+    [ ] Make compiler work on MacOS