GithubHelp home page GithubHelp logo

kixiron / crunch-lang Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 2.0 8.41 MB

A strongly & statically typed systems level language focused on ease of use, portability and speed, built for the modern age.

License: Other

Rust 99.40% Shell 0.28% Python 0.33%

crunch-lang's People

Contributors

1011x avatar cedric-h avatar kixiron avatar namibj 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

cedric-h namibj

crunch-lang's Issues

Make compiler error messages helpful

  • Friendly messages with compiler 'personality'
  • Specific errors
  • Possible solutions
  • Error codes with lookups that explain the error code
  • Run off of language files to allow easy translation?

Tooling

  • Package Manager
  • Package System
  • Build Manager
  • Debugging
  • Documentation
    • Doc tool for source files
    • Document language
    • Document std
  • Linter
  • Formatter
  • Tester
  • Benchmarking

Semantic Verification

Implement a semantic verification pass for the crunch AST

  • Desugaring
  • HIR
  • Const folding
  • Const eval
  • High-level optimization

Write the Crunch Book

Topics to cover:

  • User Guide
  • Contributing
  • GC Theory
  • Runtime Theory
  • Goals
  • TODOs with linked issues
  • Why Crunch?

How many integer sizes should be represented in the backend?

Currently, the following integer sizes are represented within a Value:

Internal Name Size Sign Use
Byte 8 bits unsigned Representing a byte
IByte 8 bits signed ?
I16 16 bits signed ?
I32 32 bits signed Pointer-width on 32bit platforms
I64 64 bits signed Pointer-width on 64bit platforms
GcInt Infinite signed Infinitely large, never overflows
F32 32 bits float Standard-precision float
F64 64 bits float Double-precision float

Are all of these useful and necessary, because having this many makes maintenance suck

Implement all primatives

  • str: A dynamically growable string stored on the Heap
  • int: A dynamically sized signed integer
  • float: A semi-dynamically sized float of up to 64 bits
  • unit: Nothing. The void consumes all foolish enough to attempt usage, for it is naught, zilch, nada. A purely typesystem-sided construct that is clobbered by the compiler
  • nullable<ty>: Makes a type able to be null. ty is the contained type. The contained value can be ty or null
  • bool: A boolean value of either true or false
  • vector<ty>: A vector of values. ty is the contained type
  • result<ok, err>: A union for error handling
  • any: Anything

Fix lexer issues

When lexing, if a Ident starts with a keyword's token (eg. exposed_function), then the keyword part (exposed) is taken as it's own token, in this case the Exposed token and the rest of the Ident is taken as an Ident, resulting in Exposed, Ident { source: "_function" } when all that should result is Ident { source: "exposed_function" }.

Fully Parse Crunch

Be able to fully parse the grammar spec and extend grammar spec to cover all bases

Finish Ballast as the main GC

Finish Ballast and fully integrate it with Crunch

  • Thread-local Heap
    • Eden area
    • Intermediate area
    • Old area
  • Shared Heap
    • Concurrent collection
    • Wait-free or Lock-free access
    • Possibly immutable

Fix CI builds

Since TravisCI is so slow on windows, make a CI file for Appveyor to run Windows Release Builds/Checks and fix the current Travis builds for Linux and OSX

Make the README readable

Currently it's a garbled mess of ideas, todos and other completely irrelevant stuff, split things into places they should be so it makes sense

Typechecking

Implement

  • Type checking
  • Custom types
  • Type inference
  • Generics
  • Traits

WASM Support

Support compilation and execution on a webassembly platform

  • WASM-specific GC
    • Single-threaded limitation

RUSTSEC-2020-0009: `read_scalar` and `read_scalar_at` allow transmuting values without `unsafe` blocks

read_scalar and read_scalar_at allow transmuting values without unsafe blocks

Details
Package flatbuffers
Version 0.6.1
URL google/flatbuffers#5825
Date 2020-04-11
Unaffected versions < 0.4.0

The read_scalar and read_scalar_at functions are unsound
because they allow transmuting values without unsafe blocks.

The following example shows how to create a dangling reference:

fn main() {
    #[derive(Copy, Clone, PartialEq, Debug)]
    struct S(&amp;&#39;static str);
    impl flatbuffers::EndianScalar for S {
        fn to_little_endian(self) -&gt; Self { self }
        fn from_little_endian(self) -&gt; Self { self }
    }
    println!(&quot;{:?}&quot;, flatbuffers::read_scalar::&lt;S&gt;(&amp;[1; std::mem::size_of::&lt;S&gt;()]));
}

See advisory page for additional details.

Codegen error on ranges

Runtime panics with thread 'vice::tests::fibonacci_iterative' panicked at 'index out of bounds: the len is 38 but the index is 38' at this program:

fn main()
    println(fibonacci(1))
    println(fibonacci(10))
    println(fibonacci(20))
end

fn fibonacci(n: int) -> int
    if n == 0
        return 0
    else if n == 1
        return 1
    else
        let a = 0
        let b = 1

        for i in 0..n
            let c = b
            a = c
            b = a + c
        end

        return a
    end
end

And all zeroes are printed in this when a sequence of 0..10 should be

fn main()
    for i in 0..10
        println(i)
    end
end

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.