minimal-compiler | Experimenting with a simple compiler for x86-64 | Natural Language Processing library
kandi X-RAY | minimal-compiler Summary
kandi X-RAY | minimal-compiler Summary
The minimal compiler project is an attempt to make one of the simplest, minimalistic languages that compiles to x86-64 assembly and machine code. Currently, the syntax is inspired by C-code with a little bit of influence from the Duck programming language. It is also modeled after Go and Objective-C to some extent. The features of the language are, at a top level, based around variable declarations and function declarations. Types are provided after names, with a trailing colon and the type name, followed by a semicolon to delimit statements. Functions are defined as they are declared. Multiple source files can be included in a project by using the include keyword and including the source filename. These source files are then treated as if they are all one piece of source code. Functions are composed of either a single statement or a block of statements. Each statement is made up of individual expressions, assignments, conditionals, or loops. If/else statements are supported. In the case of ambiguous else branches in the case of several in-line if statements, each else statement is paired with the outermost if or conditional possible. This is the opposite behavior of most other programming languages. While-loops are currently the only loop supported, out of simplicity. Local variable declarations are allowed. Functions may also return a single variable and may have any number of typed parameters. Recursion is allowed. The program's entry point is the main function. Here is an example of what a function might look like in this language. Initially, the only built in functions are intended to be prints and printi. Here are the function prototypes for each. That is the current goal. The intended platforms are both 64-bit versions of Windows and Linux, with potential support for 32-bit environments as well. Support strongly typed, static first class functions with up and downward Funargs. Maintain a comprehensible stack and memory model. Exist on a level parallel with C. Prevent exceptional runtime behavior.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of minimal-compiler
minimal-compiler Key Features
minimal-compiler Examples and Code Snippets
Community Discussions
Trending Discussions on minimal-compiler
QUESTION
When using babel-preset-typescript, typechecking is skipped. This is almost certainly faster and less memory-intensive than using normal tsc because there's no type checking overhead, and the binding and checking steps are skipped completely (it's just parsing and stripping types).
I know that exactly the same thing is not available with the TS compiler API, since babel uses a different parser entirely (Bablyon). But is there a way to do something similar and skip binding and checking for faster compilation? It looks like ts.createProgram
automatically includes type checking.
ANSWER
Answered 2019-Feb-12 at 20:16The function you are interested in is ts.transpileModule
(Source / Documentation).
For example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install minimal-compiler
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page