Coder Social home page Coder Social logo

Comments (3)

EmilySillars avatar EmilySillars commented on September 6, 2024

Update on progress!

  • I implemented marshaling/unmarshaling of SSLANG integers in Codegen.hs
    and incorporated feedback from my draft PR.

  • I added a regression test called 31bitInts.ssl

  • Things I have tested and that work in 31bitInts.ssl:
    integer literals
    parameters of reference type
    addition and subtraction of (1) and (2) together

  • Things I would like to test:
    Non-reference parameters to functions
    Local variables of both reference and non-reference type
    Bit Not
    Multiplication and division

Errors I'm getting trying to implement these tests:

main ( cout : & Int, x : Int) -> () = //pattern match error
/*sslc: pattern should be desguared into pattern match
CallStack (from HasCallStack):
  error, called at src/IR/LowerAst.hs:176:18 in sslang-0.1.0.0-KI8f4RQ6phR54Leprkbw8R:IR.LowerAst*/

let x = (5:Int) //should already be desugared
/*sslc: Should already be desugared
CallStack (from HasCallStack):
  error, called at src/IR/LowerAst.hs:133:32 in sslang-0.1.0.0-KI8f4RQ6phR54Leprkbw8R:IR.LowerAst*/

after 10 , (cout : & Int) <- (~39):Int //syntax error
/*sslc: 6:33    [241+1] :Syntax error
CallStack (from HasCallStack):
  error, called at .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/build/Front/Parser.hs:1199:5 in sslang-0.1.0.0-KI8f4RQ6phR54Leprkbw8R:Front.Parser*/

after 10 , (cout : & Int) <- (108*1):Int
/*sslc: Prelude.head: empty list*/

from sslang.

j-hui avatar j-hui commented on September 6, 2024

Awesome!

For the errors you're getting:

  • for passing multiple parameters, just pass them separately for now, i.e., main (cout: &Int) (x: Int) -> (). We don't have structured binding just yet since we're blocked on pattern matching in the front end.
  • I'm not sure what the "should already be desugared" bug is. But you shouldn't need that type annotation.
  • we don't have any prefix operators right now other than & as a type operator. I'm not sure how best to fix that easily; you could add a bnot function and then fish for that in the lowering phase, but that might just add to bloat that shouldn't be there in the first place.
  • not quite sure what that's about either. Did you add in the typing rule for multiplication?

from sslang.

j-hui avatar j-hui commented on September 6, 2024

Fixed by #41

from sslang.

Related Issues (20)

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.