Hacker Newsnew | past | comments | ask | show | jobs | submit | more MatmaRex's commentslogin

XSLT would be a classic answer, but it's a bit of a lost ancient technology these days. I've only used it in the browser for a lark, but I suppose you'd find mature (old) libraries for working with it easily enough.

PHPTAL is another system I've heard of (but never used) that seems to be built on this idea. It is also very mature (old). https://phptal.org/

In general working with DOM doesn't seem to be very cool these days. Everyone uses template systems that are glorified string concatenators, like Mustache, and doesn't care about security issues due to bad escaping.


I mean… yes? I don't see what's so confusing. In an office building, if anything goes wrong, an alarm goes off and everyone leaves, and insurance pays for damages. In a residential building, you have people sleeping, sick, possessions they might not be willing to leave behind, babies, pets… It makes sense for the safety requirements to be different.


Everything old is new again… https://github.com/seattlerb/rubyinline (2002)


Yes the idea isn't terribly new, but this implementation is significantly more elegant (and ruby-ish) thanks to what looks to be a great design and the capabilities of Crystal. rubyinline is neat but honestly not something I'd seriously consider using in a production project. I need to try out crystalruby before I have an opinion on that, but it looks very promising!


I don’t think the author is claiming that code interop is new.

But this does seem to be the first attempt at interop between crystal and Ruby, which is notable because crystal is effectively a typesafe Ruby.


There does exist anyolite

https://github.com/Anyolite/anyolite


Crystal existed in 2002?

This seems way more verbose than the project in the post.


Even older, https://metacpan.org/pod/Inline::C (about 1998)


It's used to render sheets and audio in Wikipedia articles (I hope this answers several of your questions). Example: https://en.wikipedia.org/wiki/Humpty_Dumpty#Lyrics_and_melod...


It is more pleasant to the eye if you remove the spaces:

    <infile some_cmd >outfile
Just like you wouldn't add spaces in the middle of '2>&1' when redirecting stderr to stdout:

    <infile some_cmd >outfile 2>&1


> Just like you wouldn't add spaces in the middle of '2>&1' when redirecting stderr to stdout:

Mostly because if you do it doesn’t work: '2 >&1' is not the same as '2> &1' (invalid syntax) which is not the same as '2>& 1', which …is the same as '2>&1'.


You can read about some things they did, and didn't! https://samy.pl/myspace/tech.html


It used to be that the only programs capable of somewhat correctly parsing HTML were web browsers, each one of them produced different results, most weren't open-source, and none were reusable as libraries. If you wanted to parse HTML in... looks up what MySpace was written in... ColdFusion, you were all out of luck. Since then people spent years developing specifications and writing the libraries, so now it's not a big deal.



𒐫

𒈙


In addition to the examples already given, JavaScript as well (although modern implementations do wacky stuff with the internal representations, the APIs are required to expose only UTF-16).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: