~arivigo/scalc-devel

Generic functions

Details
Message ID
<20210623001357.2u5hnqcvdxc3ticq@arch>
DKIM signature
pass
Download raw message
Dear all,
Today I added task #19 [1] to this project's tracker. If you take a
look at it, it's about two things:

    1. It's time that scalc joins the code for commands and ops into 
       one single mechanism that figures out arity, types, etc. on its
       own (but not implementing dynamic typing and half of Python for
       this...)
    2. This task is the top priority right now, so everything else will
       have to wait.

Number 2 is kinda obvious: there's a major rewrite ahead. I do have a
module that implements basic support for generic functions, but it's
still in a very early stage. Now I need to actually plug it into the
rest of scalc and that will lead to many, many, many cascading changes.

But this seems to have huge benefits in the foreseeable future! Some 
that occur to me...

     1. No more weird switch () statements and a very primitive 
        dispatching system.
     2. It opens the way for scalc to become floating point precision
        if we'd like to, because we're going to be independent of
        doubles.
     3. It opens the way for implementing users being able to define
        operations and commands during runtime.
     4. It opens a very easy way for users to implement new commands or
        operations in static modules.
     5. We could rid of the two parsers situation we've got now and
        have commands be mixed into expressions together with 
        operations.

None of this, except number 1 above, should be taken as features that
**will** be implemented. They're no promises whatsoever... just things
I've got a strong intuition about being possible with the kind of
rewrite I'm trying. Of course, talk is cheap... code is what really
talks.

Some of the ideas above might clash with my own goals with this 
project, as well... Something being *possible* doesn't mean it *must*
become a reality, you know. (Runtime-based stuff, for instance, needs
some further thought...)

I ask for a bit of patience if you were thinking of sending a patch or
understanding the codebase. These are the things that make 0.x series
so much fun, actually!

Cheers,
Ari

[1]: https://todo.sr.ht/~arivigo/scalc/19

-- 
Ariadna Vigo
Web: <https://ariadnavigo.xyz>
PGP: 0xA3B1324836A669BD
Reply to thread Export thread (mbox)