Live data from Hacker News

Forscape – A Language and Editor for Scientific Computation

github.com

21–30 of 35 posts

Re: Forscape – A Language and Editor for Scientific Computation

#21
Reminds me of https://github.com/mtarek/compitex which is a very barebones LaTeX math to C compiler. I've done a bit of work to make it better, but it really needs a lot of work, and it needs to compile to languages with polymorphism.

TFA makes me really like the idea of literate papers, with math, code, and data embedded in the paper.

Re: Forscape – A Language and Editor for Scientific Computation

#22
post #10
post #6

Earlier quoted context omitted.

you both are missing the main point here, Forscape is not for writing documents, but for writing executable code.

TeXmacs can execute code too. Honestly, if it had 1/10 the community of Emacs, I would be using it for everything from running my window manager to driving my statistical simulations. It's already what Stallman keeps asking Emacs to become.

TeXmacs and mathacademy are the reasons I've successfully rebooted my mathematical education after so long. Both are great products.

Re: Forscape – A Language and Editor for Scientific Computation

#23
post #16

I may be missing the point, but I'm not sure there is really an audience for this...obviously nice math typography is important for publishing, but I doubt the set of people who are comfortable with advanced math but who see translating those operations into a traditional plain-text programming language as a barrier, but would be fine with a more math-like syntax, is very large.

It's almost certainly not a large set of people. It's probably no larger than the set of professors and grad students who could use it. But it does seem very useful to those people. Incidentally, that's basically the same people that TeX was meant for originally.

Re: Forscape – A Language and Editor for Scientific Computation

#24
post #17

Why a new language ? Honest question ? Couldn't it be done on top of say, Julia ? The typography thing is really cool, but having to code in yet another MatLab-clone is a bit annoying (or maybe I'm missing the point)

If you have a very complex equation then it will be a lot easier to read it and think about it if it's typeset correctly than if it's written in monospaced ASCII in Julia/Python/Java/C++/Rust/Haskell/Whatever.

So then you have two options:

  - compile the typeset equation to code

  - hand-code the equation
Forscape is a third option, perhaps more akin to a Jupyter-style notebook, where you write equations and text but you can "run" those equations. Literate programming isn't quite this, not unless you automatically get codegen from your equations.

Re: Forscape – A Language and Editor for Scientific Computation

#25

Why this rather than LyX, Texmacs, Jupyter Notebook, LaTeX (and a suitable editor), or Typst (and a suitable editor)?

LyX is great, and if only LyX could a) generate code from math, b) run that code and also any other embedded code, c) produce and embed graphs and other illustrations from the results of running that code, then LyX would be perfect.

Basically we need to marry LyX and Jupyter.

Re: Forscape – A Language and Editor for Scientific Computation

#26
post #4

Why this rather than LyX, Texmacs, Jupyter Notebook, LaTeX (and a suitable editor), or Typst (and a suitable editor)?

If you asking this, you are the wrong audience. All academic journals accept submissions in Microsoft Word, this is a similar tool targeted at the WYSIWYG crowd.

LyX is WYSIWYM.

Re: Forscape – A Language and Editor for Scientific Computation

#27

Why this rather than LyX, Texmacs, Jupyter Notebook, LaTeX (and a suitable editor), or Typst (and a suitable editor)?

LyX is great, and if only LyX could a) generate code from math, b) run that code and also any other embedded code, c) produce and embed graphs and other illustrations from the results of running that code, then LyX would be perfect. Basically we need to marry LyX and Jupyter.

I believe that the Literate Programming tool which I managed to work up:

https://github.com/WillAdams/gcodepreview/blob/main/literati...

(with a bit of help from folks on tex.stackexchange.com: https://tex.stackexchange.com/questions/722886/how-to-write-... )

could be used for that --- you'd just need to execute the code once it is written out, then read the files in once they have been made.

Re: Forscape – A Language and Editor for Scientific Computation

#28
post #13

Earlier quoted context omitted.

Mathematica also has some fairly advanced typographic syntax. Matrices, subscripts, integral signs, with a decent input system to match. Type dint to get a definite integral with placeholders. One particularly nice thing about it is that it's completely optional sugar over a lispy "FullForm" syntax, and it's easy to convert between the two. I'd encourage everyone to play with it, but it's sadly non-free.

Upvoted. I have a love/hate relationship with Mathematica, but it is so far ahead of its time in a lot of ways. It's like Jupyter Notebooks dialed up by 100 and fully integrated with everything from linear algebra to calculus to graphics to graph theory to plotting to optimization and machine learning so on. I just find the functional like language (a term rewriting system) to be hard to grasp at times and it being a…

Yes. And Theodore Grey actually invented the notebook UX I believe for Mathematica around 2000-ish or maybe a bit before. Jupyter notebook came after that.

Re: Forscape – A Language and Editor for Scientific Computation

#29
post #13
post #9

This is super cool! Recently, I've been musing about the potential ergonomics of programming directly with rich typography, and here Forscape's kind of gone and done it. The project seems to be specifically targeting working scientists, but I think there's real potential for using mathematical and math-like notation in a general programming language. The array language family does adopt a few of the affordances from…

Mathematica also has some fairly advanced typographic syntax. Matrices, subscripts, integral signs, with a decent input system to match. Type dint to get a definite integral with placeholders. One particularly nice thing about it is that it's completely optional sugar over a lispy "FullForm" syntax, and it's easy to convert between the two. I'd encourage everyone to play with it, but it's sadly non-free.

> it's sadly non-free.

you could get Wolfram engine for free (use your home e-mail address) which is basically text io single seat Mathematica.

Then you download WLJS notebook interface and voila, you all set...

Re: Forscape – A Language and Editor for Scientific Computation

#30
post #17

Why a new language ? Honest question ? Couldn't it be done on top of say, Julia ? The typography thing is really cool, but having to code in yet another MatLab-clone is a bit annoying (or maybe I'm missing the point)

If you have a very complex equation then it will be a lot easier to read it and think about it if it's typeset correctly than if it's written in monospaced ASCII in Julia/Python/Java/C++/Rust/Haskell/Whatever. So then you have two options: - compile the typeset equation to code - hand-code the equation Forscape is a third option, perhaps more akin to a Jupyter-style notebook, where you write equations and text but yo…

Here's a matrix-focused DSL that compiles to LaTeX, MATLAB, Python/NumPy or C++/Eigen:

https://iheartla.github.io/

Not exactly wysiwyg typeset coding, but a close concept, compiling relatively more legible equations to code

Post reply on HN