All Projects → jfecher → Ante

jfecher / Ante

Licence: mit
The compile-time language

Programming Languages

rust
11053 projects
language
365 projects

Labels

Projects that are alternatives of or similar to Ante

Duckuino
Simple DuckyScript to Arduino C converter.
Stars: ✭ 263 (-10.85%)
Mutual labels:  compiler
Mosml
Moscow ML is a light-weight implementation of Standard ML (SML), a strict functional language widely used in teaching and research.
Stars: ✭ 271 (-8.14%)
Mutual labels:  compiler
C Compiler
C--compiler which implements LL(1)\LR(0)\SLR\LR(1) and semantic analysis and MIPS generate
Stars: ✭ 286 (-3.05%)
Mutual labels:  compiler
Gleam
⭐️ A friendly language for building type-safe, scalable systems!
Stars: ✭ 3,463 (+1073.9%)
Mutual labels:  compiler
Pyverilog
Python-based Hardware Design Processing Toolkit for Verilog HDL
Stars: ✭ 267 (-9.49%)
Mutual labels:  compiler
Re Flex
The regex-centric, fast lexical analyzer generator for C++ with full Unicode support. Faster than Flex. Accepts Flex specifications. Generates reusable source code that is easy to understand. Introduces indent/dedent anchors, lazy quantifiers, functions for lex/syntax error reporting, and more. Seamlessly integrates with Bison and other parsers.
Stars: ✭ 274 (-7.12%)
Mutual labels:  compiler
Cone
Cone Programming Language
Stars: ✭ 257 (-12.88%)
Mutual labels:  compiler
Datafun
Research on integrating datalog & lambda calculus via monotonicity types
Stars: ✭ 287 (-2.71%)
Mutual labels:  compiler
Yabfc
Yet Another Brainfuck Compiler; No dependencies and from the ground up
Stars: ✭ 269 (-8.81%)
Mutual labels:  compiler
Rascal
The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
Stars: ✭ 284 (-3.73%)
Mutual labels:  compiler
Smlvm
Smallrepo Virtual Machine
Stars: ✭ 265 (-10.17%)
Mutual labels:  compiler
Clang
Mirror kept for legacy. Moved to https://github.com/llvm/llvm-project
Stars: ✭ 2,880 (+876.27%)
Mutual labels:  compiler
Clangwarnings.com
A list of Clang warnings and their descriptions.
Stars: ✭ 276 (-6.44%)
Mutual labels:  compiler
Mint
🍃 A refreshing programming language for the front-end web.
Stars: ✭ 3,607 (+1122.71%)
Mutual labels:  compiler
Shecc
A self-hosting and educational C compiler
Stars: ✭ 286 (-3.05%)
Mutual labels:  compiler
Deepc
vendor independent deep learning library, compiler and inference framework microcomputers and micro-controllers
Stars: ✭ 260 (-11.86%)
Mutual labels:  compiler
Vult
Vult is a transcompiler well suited to write high-performance DSP code
Stars: ✭ 272 (-7.8%)
Mutual labels:  compiler
Lbforth
Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
Stars: ✭ 293 (-0.68%)
Mutual labels:  compiler
Finn
Dataflow compiler for QNN inference on FPGAs
Stars: ✭ 284 (-3.73%)
Mutual labels:  compiler
Write You A Haskell
Building a modern functional compiler from first principles. (http://dev.stephendiehl.com/fun/)
Stars: ✭ 3,064 (+938.64%)
Mutual labels:  compiler

Ante

Travis (.org)


Ante is a low-level mostly functional programming language targetted at gamedev but is still applicable for most domains. Ante aims to make it easier to write faster, safer code through region-based memory management and refinement types.

type Person =
    job: string
    name: ref string

// Ante uses region inference to infer the data allocated
// via `new` should not be freed inside this function
make_person job =
    Person job (new "bob")

// bob is only used at this scope, so it can be safely freed afterward.
bob = make_person "programmer"

// unlike ownership systems, aliasing is allowed in region inference
bob_twin = bob
assert (bob.name == bob_twin.name)

Ideally, idiomatic code should be easy to read and run fast so that developers can spend as little time as possible optimizing and more time implementing new features. This is accomplished primarily through region inference, which automatically infers the lifetime of pointers and ensures you will never run into a use-after-free, double-free, or forget-to-free unless you explicitly opt-out by using a different pointer type. Moreover, because lifetimes are completely inferred, you don't have to be aware of them while programming, making ante approachable even for developers used to garbage-collected languages. Memory within a region is allocated in a pool for the best performance, and regions tend to be small which helps reduce memory fragmentation.


Features/Roadmap

  • [x] Whitespace-sensitive lexer
  • [x] Parser
  • [x] Name Resolution
  • [x] Full type inference
    • [x] Traits with multiple parameters and a limited (friendlier) form of functional dependencies
    • [ ] Write untyped code and have the compiler write in the types for you after a successful compilation
  • [x] LLVM Codegen
  • [x] No Garbage Collector
    • [ ] Region-based deterministic memory management with region inference.
      • Easily write safe code without memory leaks all while having it compiled into fast pointer-bump allocators or even allocated on the stack for small regions.
    • [ ] Opt-out of region inference by using a different pointer type like Rc t or Box t to get reference-counted or uniquely owned pointer semantics.
  • [x] Language Documentation:
  • [ ] Refinement Types
  • [ ] REPL
  • [ ] Loops

Nice to have but not currently required:

  • [ ] Multiple backends, possibly GCCJIT/cranelift for faster debug builds
  • [ ] Reasonable C/C++ interop with clang api
  • [ ] Build system built into standard library

Contributing

The compiler is still in a rather early state so any contributors are greatly welcome. Feel free to contribute to either any known issues/improvements (some are listed in the "Quick Tasks" list below) or any standard library functions you think may be useful.

Each file in the codebase is prefixed with a module comment explaining the purpose of the file and any algorithms used. src/main.rs is a good place to start reading.

Quick Tasks:

  • [ ] Change the lambda syntax from \a b.y to fn a b -> y (#67)
  • [ ] Update the syntax for specifying the return type of a function from -> to : (#68)
  • [ ] Desugar parsing for <| (Token::ApplyLeft) and |> (Token::ApplyRight) directly into function calls (#65)
  • [ ] Add support for explicit currying via _ (#66)

Building

Ante currently requires llvm 10.0 while building. If you already have this installed with sources, you may be fine building with cargo build alone. If cargo build complains about not finding any suitable llvm version, the easiest way to build llvm is through llvmenv. In that case, you can build from source using the following:

$ cargo install llvmenv
$ llvmenv init
$ llvmenv build-entry -G Makefile -j7 10.0.0
$ llvmenv global 10.0.0
$ LLVM_SYS_100_PREFIX=$(llvmenv prefix)
$ cargo build

or on windows:

$ cargo install llvmenv
$ llvmenv init
$ llvmenv build-entry -G VisualStudio -j7 10.0.0
$ llvmenv global 10.0.0
$ for /f "tokens=*" %a in ('llvmenv prefix') do (set LLVM_SYS_100_PREFIX=%a)
$ cargo build

You can confirm your current version of llvm by running llvmenv version or llvm-config

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].