Giter Club home page Giter Club logo

moebetter's Introduction

An experimental sketch version of the Moe compiler. (I'm trying to take the patient apart, rearrange it and put it back together without killing it)

Changes:

  • Recover from errors rather than aborting on first one
  • Query based compilation
  • Multi-threaded

AST

  • String -> Using interred strings, just check pointer rather than HV, threads will need to use mutex when adding to the hash

  • SLexerLocation -> LexerSpan; should always be passed as const &

TypeInfo

  • All types should be unique from the start, don't set an AST node's type until it can be uniquely determined

  • Collapse TypeInfoInt and TypeInfoFloat to TypeInfoNumeric

Notation changes

  • No leading S/C for structs or classes
  • EWC macros/namespaces changed to MOE
  • No more pCoz/pChz, all string code should handle UTF8

Things I contemplated changing, but didn't

  • Alloc -> not using arena based loading - this would be nicer, but I don't think it will work with caching query results

Actual language changes

  • Removing acast
  • Removing for_each
  • Using unnamed types require a : before the type

Multithreading concerns

  • Each thread has write access to the AST in it's working set (parser=file, typecheck=WorkspaceEntry) and any cross set searches (symbol lookup, registry) needs to be guarded [ ] change the type creation routines to go through a typeFactory that will guarantee uniqueness and control thread access

Compile-time execution

[ ] symbols should be defined during parse and then symbol tables should be locked

  • Not all files will parse before we start type checking, this means you may need to wait for a symbol to be defined (not just waiting for defined symbols to parse) This is especially bad for function overloading

TODO - little tasks:

  • "array references" -> array slice
  • unify Proc/Procedure naming - everything should be proc (I think it's just TypeInfoProcedure)
  • fix error recovery stack to synch with multiple error outcomes ( ie. failure to parse expression list should recover to ',' or recover to '}'
  • track nested constructs in error recovery?
  • nested block comments
  • Get rid of errep passing, (just add a hide error count to ErrorManager?)

TODO - Big Stuff:

  • add module support

moebetter's People

Contributors

evcholesky avatar

Stargazers

 avatar

Watchers

 avatar

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.