So how should Perl interpret a map or printf other than using map or printf?
The print function should be called directly, because we cannot reduce it any further, but printf can be, because of the formatting. In fact, JavaScript does not have a builtin printf() function, and I decided to write one. And it's not as easy as it first sounds... The printf function could be broken down into smaller units, or it could be just a call to the builtin printf(). But I don't think this is a big issue, because there are much larger issues. For example, when the perl parser sees a line like this, it has to figure out where to even begin: $J = A() + B() * C(D(F() - 1) - E() / 2 + 1);
Then where do we stop? The perl parser could use a single variable and assume that that's the computer's memory. So, one could implement a memory manager, garbage collector, reference counters, etc. The problem is that perl is relatively new to me, so I don't even know what parts it has. I'm still at the point where I don't even know how much I don't know about perl. lol
I wrote a little program in Perl that emulates 64-bit integer math on 32-bit processors. Of course, it's terribly slow, but it's interesting. Writing that thing was as exciting as building an artificial engine made of glass. Of course, such an engine would never be used in a car; it's for show only. But still, it's fun to build!
I typed this yesterday, but I couldn't send it because the PerlMonks website was down. Even now I have trouble accessing it sometimes. It's super unreliable...
In reply to Re^2: A Perl interpreter written in Perl?
by harangzsolt33
in thread A Perl interpreter written in Perl?
by harangzsolt33
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |