Author Topic: DIY programming language  (Read 81785 times)

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
DIY programming language
« on: July 22, 2016, 12:03:39 PM »
I think most if not all programming languages kind of suck. So how about creating a new programming language? How hard it could be. I guess implementing is much harder than just a design. What I would like to do is rethink everything and not try to create another oop/functional whatever mess. There has to be more clever way.

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: DIY programming language
« Reply #1 on: July 22, 2016, 12:08:29 PM »
lol

Xecutor

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 263
  • Karma: +0/-0
    • View Profile
Re: DIY programming language
« Reply #2 on: July 22, 2016, 03:54:05 PM »
I created a programming language for myself :)
I did last three 7drls using it.
I'd say design is as hard as other parts.
If you aim for statically typed language compiled into native binary, than there is llvm.
You can generate .NET CLR, or Java  bytecode.
Or create own VM for dynamically typed language (what I did).
Jonathan Blow is working on new programming language, and progressing quite well.
So, it's not really hard.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: DIY programming language
« Reply #3 on: July 22, 2016, 05:14:48 PM »
Jonathan Blow is working on new programming language, and progressing quite well.
So, it's not really hard.

I think the problem with languages is that they are created by programmers, scientists and engineers. You know, that bunch. I'd like to see a language designed for humans, who then can write programs for computers. Languages are getting even worse, just look at the new stuff in C++.

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: DIY programming language
« Reply #4 on: July 22, 2016, 10:17:22 PM »
When people other than programmers/scientists/engineers develop programming languages, stuff like COBOL, Java and php happens, so… no thanks!

Writing your own language is surprisingly easy. It just doesn't help that much. I wrote Poslin with a whole standard library and I intend to continue working on both (because I actually really like it – is there any other language in which the user can add their own optimization passes? I only need to add the corresponding syntax making it easy enough…), but for the moment I do everything else in Common Lisp either way – when I need another way of expressing my idea of what the program should do, I write the macros which allow me to express it in a way that suits me.

My advice is this: Try to formulate what you want your language to be like. You can start fuzzy, but you will need to get concrete very fast.
You'll need to write prototypes to test your ideas – something that seems nice in your head might not work out when you actually try to program in it. Some stuff you thought would make your life easier might actually make programming incredibly hard because it has strange corner case behavior you didn't think of – avoiding these corner cases with checks doesn't really help, especially since it will make the semantics of your language even harder to understand.

Cfyz

  • Rogueliker
  • ***
  • Posts: 194
  • Karma: +0/-0
    • View Profile
    • Email
Re: DIY programming language
« Reply #5 on: July 22, 2016, 10:36:36 PM »
I am pretty sure languages being created by programmers and engineers is the sole reason humans can write programs at all. Let non-engineer write an algorithm and only a trained neural network of another human will have any chance to reliably execute that.

And I doubt any programming language inconveniences can actually bury a really good and interesting idea. It is just a tool after all. Actually, in my experience, most of the better results (be that programming, DIY, photos, etc.) were produced with subpar tools and equipment, whatever was at hand at the moment of inspiration.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: DIY programming language
« Reply #6 on: July 23, 2016, 05:31:40 AM »
When people other than programmers/scientists/engineers develop programming languages, stuff like COBOL, Java

I think Cobol is extremely engineer based. Java is different, it was supposed to be a "better C++" which is never a good starting point to create a new language. Java and D both tried to fix C++ but it doesn't work that way.

When I've been working on a large scale roguelike one of the things that has always interested me is the relationship between code and data. There is something about handling data that feels "wrong" if you know what I mean. I don't know what it is exactly, maybe the rigid way C++ handles data in extremely low level way.
« Last Edit: July 23, 2016, 05:35:04 AM by Krice »

AgingMinotaur

  • Rogueliker
  • ***
  • Posts: 805
  • Karma: +2/-0
  • Original Discriminating Buffalo Man
    • View Profile
    • Land of Strangers
Re: DIY programming language
« Reply #7 on: July 23, 2016, 01:15:45 PM »
Making one's own language is bound to be a fun exercise. So if you have the will and time, go for it. I wouldn't expect to come up with anything objectively "better" than already existing tools, although it's of course possible to tailor something to one's own taste and needs. Put differently, I would guess that writing your own language to make a RL would add a lot of development time (even if implementing the game itself would go quicker with something homemade).

As always,
Minotauros
This matir, as laborintus, Dedalus hous, hath many halkes and hurnes ... wyndynges and wrynkelynges.

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: DIY programming language
« Reply #8 on: July 23, 2016, 01:23:36 PM »
Quote
When I've been working on a large scale roguelike one of the things that has always interested me is the relationship between code and data. There is something about handling data that feels "wrong" if you know what I mean. I don't know what it is exactly, maybe the rigid way C++ handles data in extremely low level way.
That suggests a few things to me:
1. You want a language with value- instead of variable-typing.
2. You may want to look into reactive programming, which is describing programs similarly to (but more general and flexible than) spreadsheets.
3. You want automatic garbage collection.
I'd recommend Common Lisp (of course) together with cells, but cells isn't in quicklisp anymore. I don't think you'd like Haskell with reactive-banana, judging by your dislike of functional programming. I don't really know which other languages have something similar.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: DIY programming language
« Reply #9 on: July 24, 2016, 11:29:59 AM »
I'd recommend Common Lisp (of course)

I guess some of these days I should really try Common Lisp or another language that has ridiculous syntax. Just to see if it's actually possible to write any kind of program. At my age it's.. eh.. common to quit stuff if they look like there is some kind of learning curve or barrier to climb over.

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: DIY programming language
« Reply #10 on: July 24, 2016, 11:36:33 AM »
I learned programming with Delphi, Haskell and Prolog in school. I tried for years to grok C/C++ and never got anywhere – of course I understood the principles, but that somehow never coalesced into anything usable.
When I picked up Common Lisp, it just clicked and everything fell into place. he syntax is the most natural I can imagine. For me other languages have ridiculous syntax. It's all a matter of perspective.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: DIY programming language
« Reply #11 on: July 24, 2016, 11:40:52 AM »
Let me guess, you are studying math?

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: DIY programming language
« Reply #12 on: July 24, 2016, 12:13:29 PM »
You're wrong, but only by a technicality. But knowing math has nothing to do with understanding Lisp, especially since in math at the University Java (urgh) seems to be the language of choice.

I embrace both math and Lisp because both have a focus on cutting down rules to the bare minimum. The less rules I have to keep in my head, the better.
C and everything close to it seems like a huge pile of rules which don't lead to anything interesting. Lisps are smaller collections of rules which interact in awesome ways to allow for extremely powerful stuff.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: DIY programming language
« Reply #13 on: July 25, 2016, 06:42:17 AM »
I embrace both math and Lisp because both have a focus on cutting down rules to the bare minimum.

I've started to read CL manual. So it seems to be like other languages, but with shortened, more cryptic syntax. Yeah, like, that's going to help a lot.

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: DIY programming language
« Reply #14 on: July 25, 2016, 08:42:36 AM »
What CL manual? The Hyperspec? The manual of some CL implementation?

If you think that CL is like any other programming language you are factually wrong.
« Last Edit: July 25, 2016, 08:45:12 AM by Antsan »