Coder Social home page Coder Social logo

Comments (5)

hellerve avatar hellerve commented on May 27, 2024

You might be interested in a library I’ve written, match-utils which, among other things, supports this kind of function definition.

from carp.

AZMCode avatar AZMCode commented on May 27, 2024

That is indeed quite useful.
Should this sort of functionality then be provided via library instead of through the language?

from carp.

hellerve avatar hellerve commented on May 27, 2024

It depends. I did it because I felt like it was a fun challenge, and honestly because programming in Carp is more fun to me than programming in Haskell.

It does have the limitation of introducing another form, though, because you can’t really override defn—well, I suppose you could, but I wasn’t quite daring enough.

We’ve had some conversations about what should be a macro and what shouldn’t be in the past. I’m a bit of a macro maximalist, so my view is skewed. The proper objective limitation is that macros are somewhat slow; match-utils actually has an optimization pass under the hood that reorders matches to limit how many branches are needed.[1] That optimization pass runs in macro world, and macro world is not exactly blazingly fast (it’s a tree-walking interpreter, essentially). In my opinion we should just bite the bullet and optimize it, but I don’t think anyone has the time or energy to do that at the moment.

[1] I’ve got a fun paper on that lying around if you’re really interested.

from carp.

AZMCode avatar AZMCode commented on May 27, 2024

Huh. I may not be at that level yet.
Perhaps there should be a protocol to determine what ultimately gets done with the language?
Are you the BDFL of this language?

from carp.

AZMCode avatar AZMCode commented on May 27, 2024

Anyways, that's not a topic for this issue. Closing.

from carp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.