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

Roadmap #6

Open
22 of 28 tasks
mkhan45 opened this issue Oct 19, 2021 · 9 comments
Open
22 of 28 tasks

Roadmap #6

mkhan45 opened this issue Oct 19, 2021 · 9 comments

Comments

@mkhan45
Copy link
Owner

mkhan45 commented Oct 19, 2021

To start out with, we want

Eventually it would be cool to have:

  • An AST optimization pass
    • Function inlining
    • Convert atoms to ints added atoms #27
    • Convert idents to ints (should be a ~25% perf boost) (ad4b298)
    • Inline simple assignments to an existing variable, or assignments which are only used once
  • A pipe operator (b011436)
    • Function Captures
  • A module/import system with multiple file support
  • A web server module in the stdlib
  • Records/named tuples
  • Macros
  • Named/optional arguments?
@mkhan45
Copy link
Owner Author

mkhan45 commented Oct 20, 2021

named/optional arguments seem unnecessary since we can just use a map as an argument with pattern matching, but maybe there could be some syntax sugar

@mkhan45
Copy link
Owner Author

mkhan45 commented Oct 21, 2021

We also need proper error messages, to start out we'd have to revamp the scanner so that we can pass line number and maybe column information to the parser

@mkhan45
Copy link
Owner Author

mkhan45 commented Oct 21, 2021

records/named tuples might also be unneeded with maps

@mkhan45
Copy link
Owner Author

mkhan45 commented Oct 23, 2021

I've considered it don't think we should have variadic lambdas anymore. They're significantly slower than just having multiple functions unless we implement it as syntax sugar, which has other problems. Since we have a match expression already it also seems a bit excessive and doesn't work well with the let name = fn(args) => expr syntax

@WilliamRagstad WilliamRagstad pinned this issue Oct 24, 2021
@WilliamRagstad
Copy link
Collaborator

We also want the interactive REPL to not crash when an error occurs, but keep the previous state.

@mkhan45
Copy link
Owner Author

mkhan45 commented Oct 25, 2021

I've made #22 for that

@mkhan45
Copy link
Owner Author

mkhan45 commented Nov 5, 2021

currying might cause hard to debug errors, since error reporting is pretty minimal right now

@mkhan45
Copy link
Owner Author

mkhan45 commented Nov 6, 2021

Inlining functions at preprocess time might be impossible since little is known about the functions called. However, it might be possible at runtime on a block by block basis

edit: alternatively, we could add an inline keyword

could also mark a function body as inlineable at definition time, and then actually in-line it at call time

@mkhan45
Copy link
Owner Author

mkhan45 commented Nov 6, 2021

it might be possible to make a non tail recursive function tail recursive via ast transformation to use an accumulator in simple cases or by adding a stack accumulator in more complicated ones

edit: https://en.wikipedia.org/wiki/Continuation-passing_style

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