core-lang / core

The Core Programming Language
https://core-lang.dev
MIT License
45 stars 1 forks source link

extend standard library with functions using lambdas #28

Open soc opened 2 years ago

barkanido commented 2 years ago

hey, I would like to take a shot at this. I have little experience in rust but am willing to try and contribute with the proper assitence

soc commented 2 years ago

Hey @barkanido, thanks for your interest!

Out of interest, can I ask how you found this project?

Regarding this ticket: I had moved the milestone of this issue back earlier this day, because I haven't checked in a while what's the actual implementation status of lambdas in the runtime.

So it's totally possible that lambdas simply don't work at runtime; nevertheless it would still be worthwhile to write lambda-using code for the standard library (no Rust required) to ensure that the expected usage patterns are parsed and typechecked correctly.

I think Option could be a good start to add functions of higher-order. If you are unsure which functions are useful, you could have a look at Scala, Rust, Haskell and OCaml for inspiration. (I guess the basic ones are map, filter, flatMap, matches, orGet, orElseGet, ...) But we can also discuss this in more detail, if you want!

Thanks,

Simon

soc commented 2 years ago

Hey @barkanido,

I didn't want to intrude with my questions, apologies if it came across like that. I was just curious how you found this project/repository, because I didn't do any outreach or advertisement anywhere, so it was a pleasant surprise seeing someone interested!

Let me know if you have any question or suggestions!

Thanks,

Simon