
Fangle: create interactive documents from plain text - happy-go-lucky
http://jotux.github.io/fangle/
======
jotux
It's a bit weird to see this on the front page again. I did this ~4 years ago
just as a proof-of-concept. I thought it would be a neat idea to have a plain-
text way of writing forum posts that had calculations embedded.

I'm an embedded systems engineer and work almost exclusively in embedded
C/C++, so forgive my absolutely awful javascript/coffeescript coding.

Previous discussion here:
[https://news.ycombinator.com/item?id=5107106](https://news.ycombinator.com/item?id=5107106)

~~~
djsumdog
Your coffeescript looks a lot like my early Scala code. I basically wrote Java
style procedural code using Scala. Over the years I've learned more about
functional programming, immutability, mapping collections, etc. I've slowly
refactored one of my big projects (removing return statements, using Options
instead of null checks, replacing vars with vals, etc.)

Looking at your code, my brain is already reordering some of it :-P It looks
clean though. I've noticed a lot of devs like to trash on coffeescript in
favour of ES6 or TypeScript, but I've really grown to love the language. It's
also neat to look at the compiled output and see what it does to make many of
the functional elements work. Most of it makes sense.

------
mathisonian
This is cool and has some overlap with a project I'm working on.
[https://idyll-lang.github.io/](https://idyll-lang.github.io/)

Idyll provides this type of reactivity, but focuses more on making it easy for
users to embed custom interactive components

~~~
vanderZwan
Dammit, why didn't I know about this two weeks ago? This looks like a perfect
fit for my flame maps page[0] - it even uses React for custom components.

How do you handle dynamically resizing windows/screens and canvas? I had to
jump through a whole lot of hoops[1][2] just to get it to play nicely with it

Especially on Firefox canvas does _not_ seem to play nicely with flexbox, or
any kind of CSS where you don't set the width/height explicitly in pixels.

[0] [http://linnarssonlab.org/flamemaps/](http://linnarssonlab.org/flamemaps/)

[1] [https://github.com/linnarsson-
lab/flamemaps/blob/master/src/...](https://github.com/linnarsson-
lab/flamemaps/blob/master/src/components/canvas.js)

[2] [https://github.com/linnarsson-
lab/flamemaps/blob/master/src/...](https://github.com/linnarsson-
lab/flamemaps/blob/master/src/components/remount.js)

------
pmarreck
HTML5: create interactive documents from plain text!

------
gambler
The core idea is nice (using simple markup instead of code), but it seems
developers these days are completely oblivious to the fact that HTML is
extensible and was literally designed to do this kind of stuff. Markdown is
better for simple text editing, JSON is better for simple data structures, but
HTML is far superior for complex documents where you need to attach structure
and behaviors to text.

Things it buys you out of the box:

    
    
      - No need to write a parser
      - You can make complex references via CSS selectors
      - Your structure (tags) has structure (attributes)
      - All the existing tooling will help you to debug if something goes wrong.
    

On this note, I regret that HTML5 had thrown away the good ideas from XML
(syntax consistency and namespaces) along with the bad (weird sub-formats,
entity definitions, directives and other complex crap no one used well
anyway).

------
m-ou-se
This made me laugh: "His power level is [3000.1]. That's 0.09999999999990905
more than 3000."

------
hellbanner
[http://twinery.org/](http://twinery.org/)

------
elliotec
What is this? They used web technologies to try and recreate what the web
already does?

~~~
ori_b
It's markdown with widgets.

------
rubyfan
Interesting concept. The variables seem a little unintuitive to me.

~~~
jotux
Yeah, after I got it working I came to the same conclusion. I started to
create a new spec for an easier-to-understand format but never got around to
implementing it.

[https://github.com/jotux/fangle/wiki/Format-
ideas](https://github.com/jotux/fangle/wiki/Format-ideas)

------
laythea
What is the point? Why reinvent the wheel? HTML is text. Or do I miss
something?

