Coder Social home page Coder Social logo

hawkins / druid Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 83 KB

๐Ÿง™ A systems-level programming language with a focus on integrated build systems and deploying to native and web assembly at once

Home Page: https://twitch.tv/druidlang

Batchfile 8.26% C 90.63% Shell 0.91% CMake 0.20%
compiler

druid's People

Contributors

assemblydruid avatar hawkins avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

druid's Issues

[ preprocessor ] Header File "Inclusion"

All plans are subject to change as optimizations or re-structuring is needed. As a basic first step, the druid preprocessor should be able to mimic the "include" capability of the C preprocessor.

For now, this will take the form of building an ordered memory model of ASCII characters consisting of the contents of the include files, and being able to output this char stream to stdout.

CMake?

We're working on a variety of platforms (windows, mac, *nix...), we may want to try a CMake setup for consistent build products.

Druid compiler toolchain CLI

We need a tool to use that will:

  • take some input filename
  • read in that file and pass it through the pipeline

Effectively this CLI will pass fork to several child processes, the first of which will call the preprocessor on the file, then pipe to lexer, then pipe to parser, then pipe to compiler.

For no reason beyond a Druid casting magic on the file to make it do things, pretend this CLI is called cast:

$ cast hello.druid --verbose
* preprocessing hello.druid
  * summoned ./echo.druid
    * summoned :math
  * summoned :io
* parse check successful
* compiled to web assembly 
* done in 0.27 sec

Finish first pass of lexer

  • Come up with a list of token types
  • Create token struct
    • type, text, length
  • Tokenize input stream
    • From file? From stdin?
  • Write output stream
    • To file? To Stdout? Where?

Finish first pass of preprocessor

  • Handle #summon in apply
    • Read file in parameter and write in-place into fp
  • Write output to stdout
    • For use in feeding downstream, to lexical analyzer.
  • Read files into memory instead of continuously reading/writing to disk

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.