GithubHelp home page GithubHelp logo

bureaucrat's People

Contributors

kiedtl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bureaucrat's Issues

Fix memory leaks

Currently, basically no memory is ever freed. The allocator isn't even deinit'd.

Start out by writing routines for recursively freeing ASTNode's, then start deinit'ing the GPA, and piping the output traces through less to find out what else is not being deallocated.

Combinator builtins

Making dip, sip, bi@, bi*, etc builtin would provide more "structured programming"-type improvements. For example, dip would allow for refactoring the following:

move
over dup * swap -
(r move) +

into

(dip [ over dup * swap - ]) +

There would still be a manually-defined version for the stdlib though.

  • dip
  • others

Proper scoping for blocks

s/ASTNodeList/Block/g in common.zig, where Block is something along the lines of struct { body: ASTNodeList, scope: *Scope }.

Would allow for per-block locals, types, etc, and provide better error reporting (due to blocks carrying their own srcloc info). Would also allow cleaning up the Cond struct.

Shouldn't be too disruptive of a change.

Constant-type pointers, readonly ports

The idea is that pointers are marked as const using some method, and are then prohibited from being passed to words that (indirectly or directly) call STA (i.e. takes a non-const pointer).

("Marking" pointers in this case means modifying their type signature. I'm not settled on what the signature for this is -- could be @const Type, @@Type, &Type, (Cons @Type), or something else.)

Pointers can be made const in a few ways:

  • (const) to constify the pointer on TOS
  • (const foo) to constify a variable
  • #const (let CONSTANT [ 0x0 ]) to declare a variable constant.
    • Not a fan of this one, as it encourages abusing variables to hold constant values (words should be used for that).

Same principle for device ports -- writing a readonly port literal results in Const_Dev16/Const_Dev8, which cannot be passed to words that require a non-readonly port. (Not sure if adding this particular feature is worth the extra complexity. I mean, how often would one accidentally try to write to a readonly port?)

Fixed point

In-progress on the fixpt branch.

TODO:

  • Basic addition/subtraction
  • Multiplication, division
  • Printing
  • Better division routine that uses multi-word division rather than multiplying by the reciprocal
  • CORDIC sin/cos
  • Wrapper for CORDIC sin/cos that has a larger domain
  • Natural log
  • Exponentiation
  • Powers
  • Ceil, floor, round
  • Lexer/parser support for fixed point literals(?)

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.