Live data from Hacker News

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

news.ycombinator.com

71–80 of 247 posts

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

#71
post #21

I created a non-Turing complete programming language for editing animations, implemented as a GIMP Script-Fu script (Scheme, basically). Here's the documentation: http://tshatrov.github.io/animstack Why? Because in GIMP it's annoying to edit animations with many layers, so I wanted to write a script that would do what I want. But rather than hardcoding a specific action, I wrote it in an extensible way, and the rest…

Non-Turing complete languages are useful, but it has been my impression that it is difficult to be powerful enough to be useful without being (accidentally!) Turing complete.

Well, always-terminating implies non-Turing-complete, so that's a way to guarantee it.

The proof is easy: just set for all n, f(n) to be the nth program in your toy language in lexicographical order and then set for all n, g(n):=f(n)(n) + 1. This g is clearly Turing-computable (you can modify an interpreter to compute it) and not in your language (a la Cantor).

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

#72
No, but I've considered some ideas at the back-of-envelope stage:

- typesafe portable macro assembler. Used for those cases when people want "close to the metal" behaviour of C, but with less footgun potential.

- Archaeology of old language features that have been thrown out with the bathwater (e.g. COBOLs use of '.' as statement terminator, "PIC" statements)

- attempt at Perl-style language which optimises for English text readability, comprehensibility and euphony

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

#73
post #35

Earlier quoted context omitted.

> In general, I think non-Turing complete (always terminating) languages are super useful and should be used more often. yup, always-terminating functions are also called total functions (if they're defined for every input). Which is a related concept to Total functional programming http://docs.idris-lang.org/en/latest/tutorial/theorems.html#... While Idris is turing complete for example, it's possible to mark functi…

Nice one, I wish there was a Haskell extension for that! (Can't risk switching existing/pending code-bases over to Idris just for that feature though)

I remember reading about two projects og Gabriel Gonzales that might be interesting in this regard.

Dhall, a total configuration language.

https://github.com/Gabriel439/Haskell-Dhall-Library

There is Morte and Anna as well, that look like the previous experiments in total languages in haskell.

https://github.com/Gabriel439/Haskell-Annah-Library

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

#74
post #55

When I was in college, I was addicted to Starcraft II. Luckily, I primarily played 4v4s so the brainpower necessary to win wasn't nearly as high as 1v1s (which left far less room to meme, so I didn't enjoy them nearly as much). However, while playing game after game in the evenings, I was always frustrated that I was using the inputs and outputs of my body so inefficiently. Starcraft tied up my eyes and my hands, but…

This is really interesting. How are you able to multitask so well? I can't hardly listen to a podcast and code at the same time, let alone play a game.

When something becomes habitual, it frees up the cognitive load for you to think about other things. I assume parent has played so much starcraft, that many of the routine aspects of the game such as bootstrapping a base, farming resources, and building a military has become engrained. Especially in 4v4's the risk of an enemy trying to pull an early cheese is so low, that the beginning of the game is basically almost always the same.

When I was playing Diablo II, I used to be able to complete the Secret Cow Level runs with a nova sorc almost by rote. I would often be thinking about other things, chatting with friends, calling into internet radio shows while doing this

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

#75
post #72

No, but I've considered some ideas at the back-of-envelope stage: - typesafe portable macro assembler. Used for those cases when people want "close to the metal" behaviour of C, but with less footgun potential. - Archaeology of old language features that have been thrown out with the bathwater (e.g. COBOLs use of '.' as statement terminator, "PIC" statements) - attempt at Perl-style language which optimises for Engli…

I would be interested in working on the portable typesafe macro assembler!

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

#76
post #60

Earlier quoted context omitted.

Non-Turing complete languages are useful, but it has been my impression that it is difficult to be powerful enough to be useful without being (accidentally!) Turing complete.

As a Computer Scientist, I actually find the distinction Turing and non-Turing to be rather obscure. Perhaps I am in the ignorant minority on this.

A Turing-complete programming language just means that you can compute anything that can be computed using that language. In other words, it can be used to write arbitrary computations. You don't need much to achieve this; off the top of my head, I think that being able to read and write to storage, basic addition, conditionals and loops are enough. (Formally, it means that your language can be used to simulate a single-taped Turing machine.)

A non-Turing-complete language is any language which does not have one of those capabilities. Because the bar is so low, most languages you have used in your life are Turing-complete. For example, you can imagine a simple calculator-like language for just writing mathematical expressions. It can do all basic math operations, has conditions, but no ability to repeat things (no loops or recursion). That language is not Turing-complete. You can trivially prove that programs from such a language will finish - they can't not! there's no ability to impede progress.

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

#77
Yeah.

http://little-lang.org is a C like scripting language that compiles down to tcl byte codes (so it can call tcl and tcl can call it). Why? Didn't like tcl, did like tk (still feel the same way). And I always wanted a scripting language with structs, I just like how structs are sort of a self documenting part of any program.

Also created an unreleased version of awk that made awk scripts first class, you could have

    awk_script | awk_script 
in the same script. We wanted this one for some database stuff we were doing but ended up doing it in C instead.

Also created a "language" for processing deltas in a version control system. This one is pretty obscure but pretty useful. Patterned after awk, so there is a begin/end and then the body is called once per delta. Here's an example that digs out the commits and displays them in JSON format:

http://mcvoy.com/lm/bkdocs/dspec-changes-json-v.txt

when reading this one the rules are that stuff in double quotes is what is printed, the rest is logic.

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

#78
Yes, I have written a few)) Because this is the most interesting area of programming for me.

Many years ago, I wrote BNF-like language to translate text into syntactic tree, it was part of my graduation project.

I also wrote a Lisp-like lexical preprocessor as an alternative to the standard C preprocessor, it can be used with other languages, for example, with Python.

https://github.com/in4lio/yupp

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

#79
Yes, CoffeeScript, in 2009.

Despite being a modest, fun experiment in stripping JavaScript down to a minimal skin, and without any corporate backing, it wound up catching on a little bit.

Thanks to the hard work of Geoffrey Booth and Simon Lydell, among others, there's a new "V2" version that includes many ES6 and 7 features that's almost ready to go: http://coffeescript.org/v2/

CoffeeScript was designed extremely conservatively. The goal was to stick close to JavaScript semantics, to avoid having a runtime, and to avoid features that would require gymnastics and overcomplications in the output, or would run noticeably slower than the raw JS equivalent.

These days, I'm most interested in trying something from the other end of the "political" spectrum: What would happen if you tried to make a web language that wanted to strip HTML, CSS and JavaScript down to their essence — but were extremely liberal in the techniques you used to get there?

I'd like to get a chance to give that a try some day.

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

#80
I wrote a 'language' that essentially compiled down to several other languages (C++, PHP, Javascript were mostly implemented) but unlike e.g. Haxe, it didn't try to hide any of the underlying languages; instead, for parts that weren't abstracted by the language, you had to provide your own implementation blocks for each specific language. This basically made a file that was meant to be used from e.g. C++ and PHP a mix of three languages: the two you wanted to support plus my custom language.

It was mostly useful for writing boilerplate code only once; stuff like class declarations that had to change in sync between parts of one code base. But it grew from there to the point where it let you express 'pure' algorithms in this language so that you only had to write them once, but if you wanted to you could 'override' parts of it in the target languages. It was the bastard child of a compiler and a macro processor. It saved me many, many hours writing tedious boilerplate; however I don't think it saved me more than I spend on it.

It has to be in one of my zipped up archived subversion repos somewhere...

Post reply on HN