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

Assess forking, maintaining and incorporating luafun #33

Closed
Olical opened this issue Mar 17, 2021 · 6 comments
Closed

Assess forking, maintaining and incorporating luafun #33

Olical opened this issue Mar 17, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@Olical
Copy link
Owner

Olical commented Mar 17, 2021

So luafun looks very unmaintained but REALLY cool. I'd love to slowly replace aniseed.core with it, maybe shim to it for the time being while also providing aniseed.fun as another optional module you can require...

I think it'll be a GREAT building block to ship with Aniseed, I'd love to rely on it within Conjure too. My current implementations in aniseed.core are pretty inefficient, but I haven't had to worry, I've never hit any performance issues. Now I'm thinking this could help remove any issues before they even pop up.

Exciting! I could also use a maintained fork for other things at work too, so it could help me in my day to day work.

Would probably want to convert it to Fennel too 🤔 but probably still a separate repo?

@Olical Olical added the enhancement New feature or request label Mar 17, 2021
@Olical
Copy link
Owner Author

Olical commented May 2, 2021

Now thinking about it, I think that much code will just impact load time pretty horribly. Just like loading the whole Fennel compiler (which I've only just managed to prevent from loading if we don't need it).

@Olical Olical closed this as completed May 2, 2021
@glyh
Copy link

glyh commented Aug 6, 2022

Have you tested it out?

$ du -sh aniseed/lua luafun/fun.lua
288K	aniseed/lua
32K	luafun/fun.lua

I think boost the base functions by wasting 10% load time is not that horrible.

@Olical
Copy link
Owner Author

Olical commented Aug 7, 2022

I have not, no! Although it does seem cool. Although if I use it inside Aniseed it seems like one of those libraries that pollutes everything it touches, like using ImmutableJS. You have to go all in with it and teach your users that you have to use the special functions from the library to interact with some things. Something I'm not too keen on, so maybe it's just best to have users include it in their code if they need it? So it's truly optional?

I would only include it in Ansieed if I actually depended on it so users can share that tool if they need it too. But I wouldn't just vendor it in just so others can use it if Aniseed doesn't need it.

Things to consider, because I'm still sort of open to this:

  • Does adding luafun into Aniseed impact loading time much?
  • Once all aniseed.core code has it's internals replaced with luafun calls (if possible) is it faster to load and use Conjure, or is it the same?
  • Can we replace lots of aniseed.core with transparent references to luafun functions? If only one or two of them can like map and filter, maybe it's not worth it.

@glyh
Copy link

glyh commented Aug 7, 2022

I'll take a look if I have time.

@Olical
Copy link
Owner Author

Olical commented Aug 7, 2022

I've added luafun to Aniseed and swapped map, filter and reduce over to use it. No idea if this breaks everything or makes any difference whatsoever, but it's there on the develop branch of Aniseed.

@Olical
Copy link
Owner Author

Olical commented Aug 7, 2022

Okay I was wrong, I've added luafun to Aniseed develop branch but I haven't integrated into aniseed.core because the functions work very differently and return iterators, not more tables. So it is not a 1-1 conversion right now, I might be able to use these instead of my own map function etc but it won't get you the same optimisations going all in on luafun would.

So maybe I'll use luafun for Aniseed core just to remove some duplicate code, but users will have to learn and use luafun themselves to get the full speed benefit of chaining the function calls with iterators.

It's like the difference between a clojure map call and a transducer really. As far as I can tell.

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

No branches or pull requests

2 participants