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

Arguably this started in the mainframe world in 1969, with IBM "unbundling" software and services from hardware sales, after the US government launched an antitrust suit against them.

Some patterns in the GoF book only apply to C++/Java as they were in 1994, but I don't see any reason why other languages would have no useful patterns. The Linux kernel (C) is full of patterns for example.

Funny thing, Peter Norvig also has this position, that patterns only apply to languages like Java, but his book on Lisp and the Python course he had on Udemy (?) are super-pattern-y.


If you are ok with the performance you can obtain from an FPGA, you could do it now. Look at FPGA hardware-software co-design and related stuff.

If you mean, in general, for the hardware that already exists, that's what the HAL (Hardware Abstraction Layer) of the operating system tries to do.


And the FPGA is a modern day equivalent to an ULA. If they could have put all of the chips in a single programmable one, they would.


I'm old enough to have seen the "written in lisp", "written in ruby", "written in javascript" eras, among others. It's natural.


Im also old enough to recall when ruby (rails really) was the hype everyone jumped on. But i cant say i ever seen "rewritten in javascript/X" thing as its used with rust.

In rust i see that the rewrite is the important thing, not the software itself. Its completely bonkers.


I remember the books on undocumented functionality like

https://archive.org/details/Undocumented_DOS


I remember that book! I wanted to get a copy but made do with the DOS Programmer's Reference, 3rd ed., which was also very good since beej's interrupt list wasn't available yet or I didn't know about it.


Was it Ralf Brown? beej has C and networking tutorials: https://beej.us/guide/


Yes, Ralf Brown. I guess I'm getting old.


I found a copy of the PC Game Programmer's Encyclopedia (PCGPE) back then but couldn't really wrap my head around most of the articles (especially the 3D stuff and Mode X).


For me, the "human-readable" part is key. It's not just that the output is e.g. javascript, but that it is more or less human-readable with about the same organization as the original code.

If you implement SKI combinators, or three-address instructions, as functions in javascript, and that's the output of your compiler, I would not call that a transpiler.


Exactly. For a web dev oriented example, I would call coffeescript a transpiler, since it would transform

    # some comment
    myFun = -> 
       alert 'Hello CoffeeScript!'
into

     // some comment
     var myFun;

     myFun = function() {
         return alert('Hello CoffeeScript!');
     };
clearly intending the output code to be quite readable (even preserving comments).

Whereas Elm is a compiler since it transforms

  module Main exposing (main)

  import Html

  main =
  Html.text "Hello Elm!"
into

  (function(scope){
  'use strict';

  function F(arity, fun, wrapper) {
  wrapper.a = arity;
  wrapper.f = fun;
  return wrapper;
  }

  // about 4000 lines ommitted

  var $author$project$Main$main = $elm$html$Html$text('Hello Elm!');
  _Platform_export({'Main':{'init':_VirtualDom_init($author$project$Main$main)(0)(0)}});}(this));
Clearly not intended for (easy) human consumption.


Would it still count as a transpiler if it minifies the code at the end?

For example, most SCSS workflows I've worked with converert SCSS source code into minified CSS, which is pretty difficult for a human to read. But I think that SCSS => CSS still counts as transpiling.


> Would it still count as a transpiler if it minifies the code at the end?

I would say "yes, but the minimization is an additional step that is not actually a direct part of the transpiling process." :-)

So, a program that does this would not a transpiler by itself, but a program that

- executes a pipeline of which the transpiling is the most important step,

- can also be used as a transpiler by making transpiling the only step in the executed pipeline.


What if the minification is inseparable from the transpiler? Like what if it converts the SCSS into some weird graph representation, applies the transpilation features (variables, mixins, etc) on that graph representation, then converts the graph representation into minified CSS? At no point in the process was it ever human-readable CSS. I don't know enough about the internals of transpilers to know if they actually do anything like this, but one could imagine a hypothetical program that does.

And furthermore, what if you run Prettier on the minified output, turning it into readable CSS? The pipeline as a whole would input SCSS and output formatted CSS and therefore would be considered a transpiler, but the subprogram that does all of the SCSS heavy lifting would input SCSS and output minified SCSS, making it not a transpiler.

P.S. I love your username


What you describe is in my opinion a corner case. The following is just my personal opinion on this topic; it is very easy to argue for a different viewpoint:

I personally think that the central point whether it is a transpiler or not is whether the generated output is in the "spirit" in which the output language was conceived to be written by a human programmer.

So, if the outputted CSS code is in a rather similar "spirit" to how a human programmer would write it (though having possibly lots of traces of being auto-generated), it is a transpiler.

For example, if a transpiler generates hundreds of rules for CSS classes, but humans would solve the problem very differently using CSS code, it is rather not a transpiler, but some program that uses CSS as an output format for the reason that this is the output format that has to be used for technical reasons.

This of course encompasses the case of minified CSS code: hardly any programmer would write minified CSS code in a text editor.

Similarly, I would argue that a "transpiler" that generates highly non-idiomatic C code (i.e. it is "insanely obvious" that the output is not C code in the sense how the C language is "intended" to be used) is not a transpiler, but rather a compiler that uses C as some kind of high-level assembler code for output.

In this sense I would indeed say that some "transpiler" that generates highly non-idiomatic JavaScript code is in my opinion rather a compiler that uses JavaScript as an output format because it is necessary because this is necessary to run the code in the browser. I am of course aware that many programmers do have a different opinion here.

So, I would say a strong rule of thumb to decide transpiler or not transpiler is: if there was a choice to use a different output language than the destination language - would the transpiler use the latter one instead? So, to answer your question

> And furthermore, what if you run Prettier on the minified output, turning it into readable CSS? The pipeline as a whole would input SCSS and output formatted CSS and therefore would be considered a transpiler, but the subprogram that does all of the SCSS heavy lifting would input SCSS and output minified SCSS, making it not a transpiler.

If the goal is clearly to generate idiomatic CSS code that can be well understood by a human programmer, by my stance it clearly is a transpiler. If you, on the hand, create such an example just to find a corner case for "transpiler or not transpiler", I would say it is not.


'Was' is more likely. The list is from 2003, and if FORTH Inc, the (only? biggest?) remaining forth company hasn't updated it...


Forth is used in firmware and tons of places. There's ANS Forth and no need to 'update' anything, as there are tons of implementations.

As with Lisp, you can bootstrap themselves with very few primitives.


I read a comment on /r/Forth the other day from someone at NASA, implying that Forth was still actively used for something.


What's remarkable about Infocom's z-machine is the level of sophistication and polish vs the intended application, maybe unsurprising coming from MIT graduates with access to a PDP-10 as a development platform. Otherwise the use of virtual machines was, maybe not common, but not unusual.

* TinyBasic (1975) was specified (and sometimes implemented) as a VM https://en.wikipedia.org/wiki/Tiny_BASIC

* Apple Pascal (1979) was a UCSD Pascal system. https://en.wikipedia.org/wiki/Apple_Pascal

* The COSMAC VIP computer/console's (1977) games were programmed in CHIP-8, a VM. https://en.wikipedia.org/wiki/CHIP-8

* Scott Adams' text adventures (1978+) used an application-specific VM. https://en.wikipedia.org/wiki/Adventure_International

* Wozniak's SWEET16 contained in Apple II Integer Basic (1977) https://en.wikipedia.org/wiki/SWEET16

* If you count Forth as a VM, it was pretty common. https://en.wikipedia.org/wiki/Forth_(programming_language)


You must have done little research to remember those. I knew all but two. (COmSAC and Sweet16).

I wonder if the wikipedia articles are lucky enough to be good...


"Well, Steve [Jobs], I think there's more than one way of looking at it. I think it's more like we both had this rich neighbor named Xerox and I broke into his house to steal the TV set and found out that you had already stolen it." - Bill Gates

https://folklore.org/A_Rich_Neighbor_Named_Xerox.html


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

Search: