Live data from Hacker News

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

news.ycombinator.com

161–170 of 247 posts

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

#161

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 cool. You should think about doing a startup around this, especially given the new tech ecosystem with AR/VR and good voice recognition. I would love to be able to code, using a headset+phone combo, while wandering around in a park.

you're all idiots.

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

#162
Yes, Battlestar, for fun and for the educational process. It's a different take on assembly, with the goal of creating tiny executables.

I would have done it completely differently had I started again today, but it works, and "life" example code is kinda nifty.

https://github.com/xyproto/battlestar

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

#163
post #81

Inspired by Algorithmic Information Theory, the theory of shortest programs, I set out to create the simplest possible computational model with binary input and output. The Binary Lambda Calculus is described in [1],[2] and further inspired this IOCCC winner [3]. [1] http://tromp.github.io/cl/Binary_lambda_calculus.html [2] http://tromp.github.io/cl/cl.html [3] http://www.ioccc.org/2012/tromp/hint.html

I think I once read that only an exponentially small fraction of binary strings are valid BLC programs. In theory this means you could create shorter programs by merely enumerating valid BLC programs, which is bothersome. Is this a correct characterization and do you see a fix? EDIT: there's the paper https://www.cambridge.org/core/journals/journal-of-functiona... citing an exponent of 1.963447954...

> I think I once read that only an exponentially small fraction of binary strings are valid BLC programs

This is true for the encoded lambda calculus prefix; but not for the entire BLC program in which you can embed arbitrary binary data.

> In theory this means you could create shorter programs

Not really; BLC is universal, so program sizes are optimal up to a constant. In other words, for any language L, there's a constant c_L, such that for all x, the complexity of x according to BCL is at most a c_L larger than the complexity of x according to L.

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

#164

Yes; in 1997, I created a simple Javascript-like embeddable scripting language for the network security scanner product I was a part of (Secure Networks Ballista). Instead of a BSD-style sockets interface, it was designed around direct access to the network interface and had a standard library that implemented Ethernet/IP/TCP, and the language had primitives for picking apart and composing packets. We used it to to w…

[deleted]

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

#165

I've been tinkering with a language I call beep for a couple years now. It's sort of my programming equivalent of the old hot-rod sitting in the garage. I'll disappear for a weekend while I work on it and then not even think about it for a month or two. I made it/am making it mostly as an exercise. I like to know how things work, and there's no better way for me to learn than by doing. It's also just fun to make stuf…

Sounds interesting. Have you ever tried Kotlin? I've mostly worked with Ruby and C#/.NET, and Kotlin, based on JVM, feels like an interesting fusion plus a few extra tricks. It's still mostly static, like Java, but adds a ton of stuff around blocks/lambdas and non-nullable reference types.

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

#166
post #94
post #38

I created https://github.com/onnlucky/hotel for a few different reasons. 1) I wanted to see how far you can go by making every language concept first class, because only first class things can be an abstractions. 2) But another big motivation was that languages usually grow towards building large systems in. I wanted every tradeoff to go to the human side, making it more suitable for beginners. For example, 0.1 + 0.2…

Do you really think that those things make it easier? It seems like when languages do these kind of "beginner friendly" features, they just end up as gotchas and quirks. (Like in JS or SQL)

I also teach programming, and see many of the beginner mistakes made.

Part of what I tried is that the smallest subsections of the language would be complete and useful by themselves. Without ever having to say: "this part you do not need to understand yet". That is where the "beginner friendly" part focused on.

Not by making it "simpler" if that would sacrifice first class-ness. Say JS with its global scope promotion, maybe easier, but not first-class, clashes are inevitable.

And for example, the no import thing is based on very predictable scope rules, which can be postponed while learning, but later are completely deterministic and predictable, while still first class, so that the programmer can have control over it if needed.

But in a way it was mostly an experiment to get my thoughts clear on these matters. And for instance the concurrency things in there have less to do with beginner focus.

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

#168
Not technically a separate language, SaferCPlusPlus[1] is a memory safe dialect/subset of C++. As far as I know, it is by far the highest performance[2] solution currently available for addressing memory safety in C/C++ code (aside from full static verification when that is feasible, of course). The idea is basically just to replace the potentially unsafe elements of C/C++ (like pointers and arrays/vectors) with compatible (memory) safe substitutes. A nice thing about this approach is that converting existing (unsafe) C/C++ code is a simple, straightforward process (that should hopefully be (mostly) automated before long), and it doesn't require learning/adopting any new paradigms. If you want maximal performance though, you'll need to understand the technique of using "scope lifetimes" to achieve memory safety with no run-time overhead.

It's been perfectly usable for a while now, but it's not yet complete. Static tools for automatically identifying uses of potentially unsafe C/C++ elements in existing code, and (at least mostly) automated translation are still being worked on. And there are still elements that are missing safe substitutes (like std::string). So, if anyone's looking to kill some free time... :)

[1] https://github.com/duneroadrunner/SaferCPlusPlus

[2] https://github.com/duneroadrunner/SaferCPlusPlus-BenchmarksG...

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

#169
I've done a lot of little languages for game projects, at first poorly and unsuccessfully, but increasingly getting wins.

I made a postfix stack language as a scripting system to describe bullet patterns; I didn't use it to the degree I thought I would and it was hard to debug: Lessons Learned.

I made an s-expression parser and small interpreter(not particularly Scheme-like, though) for an in-game console. It added a lot of friction to make the API accessible from this parser: Lessons Learned.

I made a data language intended to allow for the composition of documents with varying node types. Subsequently I realized I had reinvented XML and started using that instead.

I made a small VM, "Ivy", intended to provide a logical abstraction for concurrency(e.g. game actor state machines), with subthreads spawned and maintained by running a special opcode(they get pushed onto a stack, and then terminated when the opcode at the base of the stack returns false). I then target the VM as the output of various data languages. The approach didn't really provide wins in practical situations as it turned out to be more expressive to have the VM spawn more instances of itself through an API call, but it has continued to be maintained and revised and the newest generation, renamed "Hedera", is mostly designed but not operational: It's shifted to a single-thread design and a new focus on clean, hot-swappable addressing of global data resources(think URIs) which I'm using throughout the game code now.

I made an XML-syntax GUI system to supplement an IMGUI. The document acts to represent the kinds of things that are normally stored in a retained-mode layout(positioning, nesting, relative scale, etc.), and it offers finer control with explicit stack push and pop and conditionals for quick disabling of elements. I'm still using this one.

I made a story engine scripted with an XML syntax. This one uses the Ivy VM described above, first compiling the data to a behavior tree system, and then to the VM opcodes. It supports concrete functions for gameplay(setting counters, rendering text, presenting choices, substituting names and personal pronouns) as well as their structuring in terms of which ones get called when, pushing story passages onto a stack, transferring outcomes to hardcoded algorithms, and support for recalling save games if the story content changes. There is a lot of customization that precluded working with Ink, Choicescript, Twine, etc. - taken in whole, the stack is probably overengineered and could have been built faster/cleaner with different approaches, but it works.

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

#170
post #152

Earlier quoted context omitted.

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…

yup memory. yup. I forgot...

"Conditionals, loops, and memory" is an interesting list of requirements, because "memory" can be abstracted into anything. Functional Languages rely on the fact that the same code shall always produce the same outcome, and thus the "tape" has been changed into a series of concrete blocks. That said, I don't think anyone would argue that functional languages are not TC, but it is interesting to consider that the Tape becomes code in Lisp...
Post reply on HN