Code Monkey home page Code Monkey logo

luf's People

Contributors

luukdegram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

luf's Issues

Add a WASM backend

Would be cool to be able to write Luf code, and compile to WASM, rather than having to write WASM code directly. Especially because Luf has type-safety and is a lot more readable than WASM text.

Optimize simple instructions

Some instructions can easily be optimized such as:

const x = 5 + 5 can be optimized to const x = 10.
const myFunc = fn() { return 5 } can be optomized to return 5.

Implement optionals

Luf already supports nil literals, but assigning nil to a variable will make its type nil as well.
Optional should be seperate type that must be handled before usage, similair to how Zig handles them.

Allocate error messages so we can format them with arguments

Currently error messages require to be comptime known, cuasing us to lose runtime known information, such as an en expected type. By allocating them we can use std.fmt.allocPrint() to make fancy error messages.

Ensure we do not forget to free all memory created by those messages. Either by deinit() or when write() is called.

Improve the test bed for Luf

Currently all tests are handwritten within Zig with a lot of expects().
This is not really manageable, and takes quite some work to update on changes.
We should look into behavioral tests.

Add a basic CLI for compiling/running Luf

Currently, the user would have to create their own Zig project first, and embed the VM to be able to write Luf code. Luf should also come as a standalone CLI tool that can run both Luf files as well as compiled bytecode for faster execution using flags.

Experiment: Allow compilation to typed ZIR

It would be a cool experiment to compile to typed ZIR that can be used by Zig's compiler to compile it to machine code and see its effect on performance compared to regular Zig code.

Obviously we will have to comply with Zig's semantics and type system, allowing us to only implement features that are supported by Zig. We will also have to handle memory usage someway.

Add support for calling Zig functions

  • Add compiler support for 'packages' for type support. (compiler doesn't know anything about this package, therefore we should ignore type checking for those cases but return a general .module type or something like that).
  • Add function to value.zig to wrap a Zig function into a Luf Value.
  • Add VM support to add Zig functions as a 'package'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.