valyrie / vul Goto Github PK
View Code? Open in Web Editor NEWplaying around with writing a compiler in ocaml -- extremely wip -- don't email me about it
playing around with writing a compiler in ocaml -- extremely wip -- don't email me about it
Move scattered TODOs and notes into a centralized location (github issues) for tracking purposes.
Tokens do not currently track which file they originate, in. This makes recovering the text which produced a token impossible.
The current lexer/parser cannot be tested without first doing the plumbing work between it and the cli in vul.ml
Currently, the verbose flag does nothing. This should increase the verbosity of the compiler, causing it to emit additional diagnostic information.
Currently, the lexer accepts prefixed numbers that start with a _, such as 0h_A
and 0y_
. This behavior is erroneous, particularly in the second case, where it is possible to construct an integer literal without any digits.
Additional flexibility when specifying integer literals via suffixing of the form C053h
would be a nice quality of life addition to the lexer.
Currently, code formatting is not enforced in any consistent way -- it would be preferable to have some sort of autoformatter on commits, or at least a formatting discipline documented somewhere.
A repl-mode could be provided by adding additional machinery to read from standard input
AST types should be lifted out into a dedicated module
It is impossible to generate a signed numeric literal in the lexer. This should be remedied by permitted a prefix of -
or +
to a numeric literal during lexing.
The usage of _ as a wildcard identifier is desirable for destructing and pattern matching where the specific value of a field is irrelevant. This would make future implementation of a match ... with ...
construct much nicer.
Support for special strings, such as python's raw string syntax, would be desirable.
At the moment, I've only figured out the following special strings:
raw strings of the form r"text"
, which do not parse escape sequences
non-terminated strings of the form b"text"
, which do not have a terminating \0
appended
Symbolic constants of the form :symbol
and :"symbol"
would be quite nice to have when writing code for which the precise value of a constant doesn't matter, only that it is unique.
Ast.Expr is doing double-duty as both an AST representations and symbolic expressions. This should be broken up.
Artifacts are needed to print the sexp of a module, plus dump a module's symbol table
The parser, and anything downstream of it, have yet to be implemented; but once the lexer is complete enough, the parser should be the next target.
Cmdline interface, when passed an invalid switch, tries to interpret it as a filename. This is incorrect, and invalid switches should be detected and reported as such.
When created from a path, Output.t tries to open that path. If the path doesn't exist, it fail with a cryptic message about being unable to open the output file.
In this case, it would be good if the error raised an exception that explained the particular issue to the user, and perhaps gave them a hint as to how to fix it?
Currently, the cmdline interface prints quite cryptic errors when the user makes a mistake invoking the tool.
Ideally, vul.ml could print some sort of help text for these sorts of cases, guiding the user towards the correct usage (even if that's just telling them to run vul -h
)
looks in the dispatching logic of lex_token don't reference the version of the input which has been stripped of leading whitespace -- these leads to confusing, inconsistent, and buggy parses
Before more advanced work on the parser can happen, support for s-expressions needs to be finished.
More advanced syntax will be built on top of this.
Cons isn't being constructed in a way that enables differentiation between (x y)
and (x (y))
The lexer needs to be able to generate the unit type ()
It is impossible to encode identifiers which contain special characters, such as (
. Implementation of a lexical construct in the form of i"identifier"
would remedy this.
String escape sequences are incredibly limited, and it's impossible to encode characters via hexadecimal escape, octal escape, or unicode codepoint escapes.
Numeric literals with fractional components are entirely unsupported. This makes any potential work with floating point or other fractional number formats impossible.
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.