Comments (3)
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.
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 abnot
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.
Fixed by #41
from sslang.
Related Issues (20)
- newnew1 test case is broken
- Generalization bugs with type annotations HOT 1
- Blink 3 test case hangs
- Lambda lift breaks recursive let definitions HOT 11
- Scanner Breaks on Character Literals
- Memory leak due to wrong main function signature
- Support break statements
- Support time-related primitives
- Add builtin booleans HOT 1
- Don't rely on mangled names for AST equivalence checks HOT 1
- Postfix function type annotations don't make it past type inference HOT 4
- CI takes a really long time to run HOT 1
- Correctly elide type annotations HOT 3
- Add type annotation syntax for lambdas HOT 2
- Add tuple literal syntax HOT 3
- Codegen might not know when to yield HOT 2
- blank line or comment at top of .ssl file fails
- match indentation error
- Optimize ADT structs for reuse
- multiple argument functions fail on AST lowering pass
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sslang.