Hilbert: A Latex-like math-oriented programming language
hilbert-lang.org
hilbert-lang.org
The integral example already given is one. One must wonder what is going on "under the hood" to give such a result. My hypothesis is that Riemann sums are what's going on, and that the integral uses 0 as a sample point. An interesting point is that this is one of the unit tests. https://github.com/gogotanaka/Hilbert/blob/master/test/inter...
Another is the example of lim[x->0] 1/x => oo. This is not true; the limit does not exist. If one said lim[x->0+] => oo there would be a better case. Also a unit test. https://github.com/gogotanaka/Hilbert/blob/master/test/inter...
(1 2 3; 4 5 6) * (1 2 3) => (14 32) is not how matrix multiplication is normally done. ( (1 2 3) would need to be (1; 2; 3).)
All in all, the grammar seems to be quite irregular; it seems to be the result of a sequence of wanting to solve one very particular kind of problem (take a limit, differentiate a function, take a sum) and cludging it into the parser.
https://github.com/gogotanaka/Hilbert/blob/master/lib/hilber... has seven exclamation marks in a row. That's amusing... I don't know anything about Ruby, but I feel that it must be a joke.
This is one of the grey areas of the mathematical notation. When you are teaching this, you should confirm that the other teachers are using the same notation.
I usually use oo as "I don't care about the sign infinity", so with the notation I use this is correct. For the positive infinity I use +oo and for the negative infinity I use -oo. So
lim[x->0+] => +oo
lim[x->0-] => -oo
Nevertheless, I don't know if the difference between oo, +oo and -oo is implemented in this language.
S(log(x)dx)[0..1]
=> - oo
It's not very convincing when one of your examples is mathematically wrong (the integral should be -1).Edit: GitHub Issue filed at https://github.com/gogotanaka/Hilbert/issues/60.
Looking through the README, the first thing that made me balk was the fact that the limit of `1/x` as `x->0` is not infinity. The limit doesn't exist! However:
* The limit as x goes to zero from the right of `1/x` is infinity, and
* The limit as x goes to zero from the left of `1/x` is negative infinity.
So, to quickly determine whether or not this was just a documentation issue, I installed Hilbert ([and eventually succeeded](https://github.com/gogotanaka/Hilbert/pull/68 )) and tried to discover the syntax for one-sided limits:
``` Enjoy! -> lim[x->0+] 1/x
Enjoy! -> ```
Hmmm...no output. Okay. Does any output work?
``` Enjoy! -> 3+2
5
Enjoy! -> ```
Okay, good, we at least have that much... Hmmm...
``` Enjoy! -> lim[x->0^+] 1/x
Enjoy! -> ```
Nope, that's not it, either. Poking at the source code, [it doesn't seem as though one-sided limits are implemented](https://github.com/gogotanaka/Hilbert/blob/1750822d0577e69ab... ).
Well, okay, how about a simpler limit?
``` Enjoy! -> lim[x->0] x+2
Enjoy! -> ```
Uhhh...okay, how about some differentiation?
``` Enjoy! -> d/dx(cos(x))
I'm so sorry, something wrong. Please feel free to report this.
Enjoy! -> ```
This error message is of no use, and I have no idea what's going on, but this language appears to be broken.
Enjoy! -> lim[x->0] 1/x
oo
Enjoy! -> d/dx(cos(x))
- sin( x )
Enjoy! -> lim[x->0] x+2
2.0The button on https://github.com/gogotanaka/Hilbert/issues/new is enabled for me now, and was enabled yesterday too. I think you forgot to fill in the title of the issue as well as the body – the button stays grayed out if you don’t have a title.
I posted that issue for you at https://github.com/gogotanaka/Hilbert/issues/69.
>> Fortress is being designed from the outset to have multiple syntactic stylesheets. Source code can be rendered as ASCII text, in Unicode, or as a prettied image. This would allow for support of mathematical symbols and other symbols in the rendered output for easier reading.
[1] http://en.wikipedia.org/wiki/Fortress_%28programming_languag...
Something about suddenly SCREAMING someone's name right in the middle of the code feels like a (harmless, virtual) version of Tourette's. :) Of course no disrespect meant to people who actually suffer from that.
Admittedly, that's way more ambitious than anything anyone's actually implemented, ever...