Group Abstract Group Abstract

Message Boards Message Boards

0
|
12.7K Views
|
9 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Implement Mathematica in Mathematica

Anonymous User
Anonymous User
Posted 8 years ago

Has anyone written Mathematica code simulating the Mathematica evaluation process (or at least some of its basics)? A Mathematica emulator (not the heavy math stuff like integration and reduce), written Mathematica, but using a small subset of Mathematica's functions? I hope one of you thinks it is fun, because it would be far beyond my ability, but the results would at least be helpful to new users trying to understand what Mathematica does. Once you learned said small subset of functions, you could understand the emulator's code; and once you understood the emulator's code, you would understand Mathematica. I cannot pay though, so I hope this sounds fun.

POSTED BY: Anonymous User
9 Replies

Concerning the interest of the subject, since WL is an interpreted language, the compilation bootstrapping (wikipedia Compiler bootstraping) is not necessarily an applicable paradigm (although it will eventually happen in the near future). Nevertheless, considering the interpretation as a compilation substitute, I guess that this is somehow related... isn't it?

It is my understanding that the WL runtime library is being revamped mostly with C++ (or code of the same family), I guess with the purpose of having the fastest implementation possible. Nevertheless, I don't think it would be completely out of the question to have a runtime written on WL and compiled with the WL (compiled) compilation library... Most likely not as fast, as the compiler automatic optimization is eventually not capable of compensating for some astute human brain speed optimization strategies, but it could probably facilitate the port of the runtime to other platforms? (well, I guess that the programming language of the runtime is already LLVM compilation "compatible", facilitating the port to other platforms...). Would love to have a micro^2 kernel (one micro for the subset, another micro for the device aspect) running on a ESP32, both running binary and the interpreter (similar to micropython); but since there's still no LLVM translation to Xtensa... (in a few years...)

POSTED BY: Pedro Fonseca

I know this note is only slightly related but anyway: I guess you could find an ability to perform a 'step by step' evaluation useful. A set of functions related to Trace can help with that. There are even 3rd part utilities to make the result more readable:

The clearest way to represent Mathematica's evaluation sequence

POSTED BY: Kuba Podkalicki
Anonymous User
Anonymous User
Posted 8 years ago

That looks very interesting to me. Thank you.

POSTED BY: Anonymous User
POSTED BY: Szabolcs Horvát
Anonymous User
Anonymous User
Posted 8 years ago
POSTED BY: Anonymous User
POSTED BY: John Doty
Anonymous User
Anonymous User
Posted 8 years ago
POSTED BY: Anonymous User
POSTED BY: Szabolcs Horvát
Anonymous User
Anonymous User
Posted 8 years ago
POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard