Live data from Hacker News

Ask HN: Have you created a programming language and why?

news.ycombinator.com

191–200 of 247 posts

Re: Ask HN: Have you created a programming language and why?

#191
post #68

Earlier quoted context omitted.

Isn't it just possessing both conditionals and loops?

Not necessarily. Purely functional languages, like Lisp, do not have loops. Instead they have recursion. Any iterative algorithm (I.e. one with loops) can provably be converted to a recursive algorithm with out iteration.

Lisp has loops:

For instance, the do operator:

  (do ((i 0 (+ i 1))) ((> i 10)) (print i))
Or the loop macro:

  (loop for x below 5 and y in '(a b c d e)
        collecting (list x y))
The 1965 manual for Lisp 1.5 describes the prog construct, which persists into ANSI CL. Inside prog we can have labeled statements to which we can branch unconditionally with go in any direction. Lisp also has mutable variables. The following example from the Lisp 1.5 Programmer's Manual is still valid code today:

  (LAMBDA (A)
    (PROG (B)
  S   (SETQ B A)
      (COND ((NULL B) (RETURN C)))
      (SETQ C (CONS (CAR A) C))
      (GO S)))

Re: Ask HN: Have you created a programming language and why?

#192
post #68

Earlier quoted context omitted.

Isn't it just possessing both conditionals and loops?

One more thing - memory. A Turing Machine is literally just a tape, a movable reader/writer, and a bunch of states that dictate what the reader/writer does. As long as you have memory, the ability to write to memory, conditionals, and some form of looping, whether it's a `while` loop, a `for` loop, or a `jmp` or `GOTO` instruction, it's Turing complete. Note that a conditional jump (`jne`, for example) satisfies both…

"Turing Complete" refers to a system which can be configured to be come any Turing Machine. When we write a particular program in some language and run it on some input, we have a Turing Machine. If the language lets us create any Turing Machine (i.e. do any Turing computation), then it is a Universal Turing Machine, and Turing Complete.

Turing's Tape Machine is a UTM because the tape can be initialized with contents to turn it into any TM. Any calculation for which there is a TM can be done by the UTM (if someone can figure out what to put on the tape).

Re: Ask HN: Have you created a programming language and why?

#193
post #184

I created D because I could implement new ideas without waiting years.

What do you mean?

To improve C++, I'd need to write proposal papers to the committee, mount a campaign to get it accepted, attend all the committee meetings, and wait years for the next standard to get through the process.

With D, I could implement it and ship it in a few days or weeks.

Of course, I could (and did) add features to the C++ compiler I developed. But I soon discovered that nobody was interested in using features that were not part of the standard - even the people who proposed the features would not use them.

Over time, many of the improvements put in D found their way years later into the C++ standard.

Re: Ask HN: Have you created a programming language and why?

#194
post #184

Earlier quoted context omitted.

What do you mean?

To improve C++, I'd need to write proposal papers to the committee, mount a campaign to get it accepted, attend all the committee meetings, and wait years for the next standard to get through the process. With D, I could implement it and ship it in a few days or weeks. Of course, I could (and did) add features to the C++ compiler I developed. But I soon discovered that nobody was interested in using features that wer…

Of course, D having a much larger community these days means that improvements take longer from conception to ship. More community means more process.

Re: Ask HN: Have you created a programming language and why?

#195
post #92

I created a language called MoonScript in 2011 It is heavily inspired by CoffeeScript (and Python), it works as a transpiler for Lua. I've since used it regularly to code dozens of projects. It's now powering my company along with a handful of websites and supporting libraries. I've also made games and GUI apps with it. The adoption has been pretty minimal, but I'm satisfied regardless. It has definitely improved my…

leafo! This made the thread 10x better, for me at least :)

Since he doesn't want to mention his company, it's called itch.io. It's a game marketplace -- kind of like Steam -- but with a ton of pretty interesting ideas when it comes to advertising, pricing, etc.

The really cool thing is that the site is written entirely in MoonScript AND uses the Lapis web framework, which he also wrote entirely in MoonScript.

Anyways, if you're ever looking for a place to host and/or sell your game, itch.io is definitely the place to go.

Re: Ask HN: Have you created a programming language and why?

#198
post #68

Earlier quoted context omitted.

Isn't it just possessing both conditionals and loops?

Not necessarily. Purely functional languages, like Lisp, do not have loops. Instead they have recursion. Any iterative algorithm (I.e. one with loops) can provably be converted to a recursive algorithm with out iteration.

While another commenter has mentioned that this is technically not correct with Lisp, it holds for the lambda calculus. You don't need loops to be TC if you have recursion. And for that you don't even need named functions-- note the URL of this site!

Re: Ask HN: Have you created a programming language and why?

#200
I've created several bytecode interpreters, mainly for bootloaders and cross-platform drivers. These environments are sometimes very space constrained, so using the native instructions to do highly repetitive I/O to set up devices can blow your space budget. Instead, I shrink the instruction set down to (usually) 4 bit codes with packed immediate data in a 16 or 32 bit word. In one case, a SH4 based set-top box, this reduced the bootloader from 30+k down to a single flash page. This meant that we could have redundant bootloaders instead of just one copy, and that increased platform reliability and serviceability quite a bit.

I also wrote a BPF-like JIT for network packet matching once, targeting the QorIQ pattern matching engine as a backend.

Post reply on HN