I'm currently making a programming language that tries not to be a programming language. To give some background: I'm working on a program to allow anyone to create video games. But to add custom functionality, my users need to use some kind of programming/scripting language. Since these are non-technical people, it must be as easy and simple as possible. Therefore I'm now making a language (called Screenplay) where…
Ask HN: Have you created a programming language and why?
121–130 of 247 posts
Re: Ask HN: Have you created a programming language and why?
#122I created a language. I was refactoring a very complex class at work that was hiding a very unsafe one liner of python doing a «safe» eval that was nowhere near safe. And after 3 days of mine + the 3 weeks from the team that appeared in the git on the work of this class, I thought, well I am told I am an idiot, but I am pretty sure one can make a safe language that only includes what customers need without taking as…
Forgive me, but I'm leaning toward siding with that CTO on this one.
Re: Ask HN: Have you created a programming language and why?
#123Re: Ask HN: Have you created a programming language and why?
#124I 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 stuff. Last (and definitely least), it's an expression of a certain degree of frustration I have with the current offerings. My dream language—oh, maybe I should've named it "dream"—would feel like Ruby but have static types and no nil references. I wholeheartedly acknowledge the tension inherent in that statement; much of Ruby's power comes from its dynamism. But like I said, it's just an exercise. :)
Not sure if that qualifies as not-a-toy-language. Is a language's "toyness" based on its simplicity, or its intended use?
Re: Ask HN: Have you created a programming language and why?
#125Its core feature is emergence/composition, to demonstrate its power, let me show you a SCARY example of a factorial function:
factorial : [ = ] ? 1 | [ - 1 factorial * [
Now, let me show you the exact same program using an EVEN SCARIER "language pack" (note, this is the exact same program, nothing is different) here:
Define the factorial function to be that if the left parameter is equal to the right parameter then return 1 else wise please take the left parameter , subtract one , recursively calling the factorial function again multiplied by the right parameter .
That terrible "english" is the EXACT SAME program as the first line, the interpreter doesn't know there was any english. I do not recommend ever coding with plain english, but it demonstrates the power of emergence/composition/currying with the language.
If anybody is curious, I'd love to explain more / chat with people / show demos. I'm ultimately going to switch the programming language's interpreter to be built with a database (the one I'm working on, http://gun.js.org/ ) so that way I can have a Turing Complete database system. Once that is working I will then be able to evaluate programs across multiple machines simultaneously and modify programs dynamically on the fly, as well as reduce O(N) operations to O(1) by spinning up N number of machines (for large enough data sets that make it worth the overhead of splitting up the load).
I wish they recorded the talk, I'll have to do it again and post it. It had a lot of other interesting ideas, like combining it with Machine Learning to sample inputs and outputs of functions to see if the computer could optimize algorithms and then issue a pull-request to its own code, becoming a contributor. :)
Re: Ask HN: Have you created a programming language and why?
#126Before this, I was on a team building a programming language for financial analysis. It had basic javascript semantics, was interpreted, and mostly returned results as data visualizations to browser based UI. Why? Because the investors believed there is a significant market for bundling data sources, along with a proprietary programming language to hedge/mutual funds. The real difficulty in achieving this is the man-years of time required to build a language capable of reproducing the same analysis used in by quants in production before ever being able to apply a technology, like GPUs, you bet can make things better. It can be especially difficult for the business leaders to make decisions that impact a programming languages development, as the highly technical quickly meets the business relevant. If you ever go this route, have system architecture/design for the programming language that will bring you to a MVP. Otherwise, you'll be paying developers to play with prog lang ideas for years!
Re: Ask HN: Have you created a programming language and why?
#127Re: Ask HN: Have you created a programming language and why?
#128I play language designer in my free time, I have like ten languages buried in folders with thousands of abandoned projects. My recent endeavour was a language with only five constructs that would mimic mathematics in the way we program: = assign $ print @ loop ? condition ! else # definition/function So print hello world would be like: $ 'Hello world' Every single program in the whole universe can be easily translate…
Re: Ask HN: Have you created a programming language and why?
#129Yes, EasyAM, a programming language for organizing analysis conversations. I created it to eliminate: 1) Situations where different people in an organization have conversations about the same thing and reach different results, not being aware of the duplication 2) Situations where lots of people in an organization are forced to copy and repeat the same information over and over again 3) Churning and duplication of ef…
Re: Ask HN: Have you created a programming language and why?
#130I had to query lots of data from webpages, so I made a pattern matching language where the program is a sample of the webpage. E.g. to query the the text of some text, you write the "program"/pattern {.}. Or if the webpage had multiple some text, you would use the pattern {.}+
Then I noticed, you sometimes need more expressive power than simple patterns, e.g. returning an element depending on the value of another element, so I added variables and allowed some kind of XPath expressions inside the {}. It was not really XPath, because XPath 1 has no variables, but after a while I noticed, XPath 2 has variables. There was no XPath 2 interpreter for the host language, so I implemented a standard-conformant XPath 2 interpreter for this. Not really my language, but my implementation of a language. Later I updated it to XPath 3, which became far more complex than expected, since XPath 3 does not just has variables, but is fully Turing-complete with anonymous functions. And a type system with 50+ different types. Makes JavaScript look trivial. I also noticed, XPath 3 is almost the same as XQuery 3, so I implemented that, too. http://www.videlibri.de/cgi-bin/xidelcgi
Which brings us back to your XmlPl, because XQuery was designed for the same tasks. That example node[] main() { helloString; } would become declare function main() as node() { {$helloString} } in XQuery.
Previously I made a completely different XML processor for my personal webpage. Keep all content in XML files, make an HTML file for the layout of the webpage, and then insert the data from the XML in the HTML at statements like {{$WRITE some/kind/of/xpath }}. It had control structures {{$IF}}, {{$FOREACH}}. I thought it was a good idea to keep the program separate from the markup, but it only looks confusing, so stopped using that language.
Most recently I made a language to sort my mails when they arrive on the server. More a toy than a full programming language, but the cleanest way to keep those filters http://hg.benibela.de/mailfilter/