Code Monkey home page Code Monkey logo

rustre's People

Contributors

edgarogh avatar elegaanz avatar lucaasmth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rustre's Issues

Properly decode this latin-encoding thing

2 solutions :

  1. We ditch strings altogether. That's radical but not necessarily impossible, it mostly depends on rowan's and logos' ability to work with byte slices. That's why Paths exist in Rust in the first place : they may not be UTF-8. Clearly the best solution if it's doable.
  2. We convert files before parsing them. That's unfortunately a bit slower and IMO a little more undesirable as we're clearly transforming user input just because we like it better. That also prevents us from pretending to be 100% compatible with lustres's spec. And this also requires asking the user which encoding their files are in, which is a new CLI parameter/function argument

Edit: byte slice support

  • logos: should be good in theory, but I don't know if regexes work well with non-string input
  • rowan: unfortunately, the GreenNode::new constructor takes an &str. We can try to open an issue, but if this doesn't work, it's always possible to cheat. We could for instance encode the byte slice as base64 and prepend a discriminator char. Dirty, but still better than option 2 IMO as we're not imposing our own rules.

Optimize the lexer

The current algorithm works well but is terribly slow. Another algorithm that should work as good and be much faster :

start = 0
end = 1
while start < src.len()
    matches = tokenize(src[start..end])
    if matches.len() == 1
        push matches[0]
        start = end
        end = start + 1
    else if matches.len() == 0
        error "unexpected character"
    else
        end = end + 1

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.