Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more types: Floats, Structs and stuff #13

Open
chsasank opened this issue May 31, 2024 · 7 comments
Open

Add more types: Floats, Structs and stuff #13

chsasank opened this issue May 31, 2024 · 7 comments

Comments

@chsasank
Copy link
Owner

Add floating point types

https://capra.cs.cornell.edu/bril/lang/float.html

and tests:

https://github.com/sampsyo/bril/tree/main/test/interp/float

Look up how do we add char and stuff too

@chsasank chsasank changed the title Add more types Add more types: Floats, Structs and stuff May 31, 2024
@chsasank
Copy link
Owner Author

chsasank commented Jun 4, 2024

The types we need to implement:

  • 1. Floats
  • 2. Structs
  • 3. Arrays

In that order of priority. See #16 for interesting discussion on array type vs alloc

@chsasank
Copy link
Owner Author

chsasank commented Jun 4, 2024

Aggregate types in LLVM are documented here: https://llvm.org/docs/LangRef.html#t-aggregate

@GlowingScrewdriver
Copy link
Contributor

GlowingScrewdriver commented Jun 22, 2024

Structs will have to be implemented in Brilisp and C-Lisp.
As with the other features, Brilisp structs will mirror LLVM structs, and C-Lisp structs will extend that to provide something more typical of a high-level language.

Tentative design decisions for Brilisp structs:

  • No element names, only indices (as with LLVM)
  • Structs will be allocated in memory using alloc and accessed through pointers only, just like arrays
  • No nested structs

@GlowingScrewdriver
Copy link
Contributor

This is done, right?

@GlowingScrewdriver
Copy link
Contributor

Ah, yes. We still don't have characters.

@chsasank
Copy link
Owner Author

Partly resolved by #68

@chsasank
Copy link
Owner Author

We're done with structs in #37. We might need to implement arrays for #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants