kixiron / crunch-lang Goto Github PK
View Code? Open in Web Editor NEWA strongly & statically typed systems level language focused on ease of use, portability and speed, built for the modern age.
License: Other
A strongly & statically typed systems level language focused on ease of use, portability and speed, built for the modern age.
License: Other
Compile all of Crunch to valid, sound bytecode
Add a pass over the produced bytecode to apply bytecode-level optimizations, such as reducing redundant push/pops and register movements
Add fuzzing using afl.rs for random input and libfuzzer-sys for random token generation
Implement a semantic verification pass for the crunch AST
Topics to cover:
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
str
: A dynamically growable string stored on the Heapint
: A dynamically sized signed integerfloat
: A semi-dynamically sized float 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 compilernullable<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 typeresult<ok, err>
: A union for error handlingany
: AnythingWhen 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" }
.
Be able to fully parse the grammar spec and extend grammar spec to cover all bases
Use Ramus for lexing when it stabilizes to replace logos dependency
Finish Ballast and fully integrate it with Crunch
With rust-lang/miri#1769 having landed, this way of passing Miri flags will soon stop working:
crunch-lang/.github/workflows/main.yml
Line 255 in e51945a
This should now instead be
MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test
cc @cedric-h You ok with moving to Zlib?
Use tagged-box for wrapping Values, because NaN-boxing reduces memory consumption
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
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
All combinations need to be covered, e.g. Byte
and BigInt
Implement
Support compilation and execution on a webassembly platform
read_scalar
andread_scalar_at
allow transmuting values withoutunsafe
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(&'static str);
impl flatbuffers::EndianScalar for S {
fn to_little_endian(self) -> Self { self }
fn from_little_endian(self) -> Self { self }
}
println!("{:?}", flatbuffers::read_scalar::<S>(&[1; std::mem::size_of::<S>()]));
}
See advisory page for additional details.
Create VSCode and Vim syntax highlighting
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.