12 Replies - 805 Views - Last Post: 05 November 2018 - 08:59 AM

#1 BasketballFan589   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-October 18

What language should I use for making a language?

Posted 26 October 2018 - 10:20 AM

What is the best language to use to invent a new language?
Is This A Good Question/Topic? 0
  • +

Replies To: What language should I use for making a language?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14496
  • View blog
  • Posts: 58,109
  • Joined: 12-June 08

Re: What language should I use for making a language?

Posted 26 October 2018 - 10:46 AM

Compiled or interpreted?

https://medium.freec...ne-91d3f449c919
Was This Post Helpful? 3
  • +
  • -

#3 BasketballFan589   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-October 18

Re: What language should I use for making a language?

Posted 26 October 2018 - 12:33 PM

View Postmodi123_1, on 26 October 2018 - 10:46 AM, said:



What do you recommend?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14496
  • View blog
  • Posts: 58,109
  • Joined: 12-June 08

Re: What language should I use for making a language?

Posted 26 October 2018 - 12:37 PM

*shrug* I don't see a need to make a new language so the ball is in your court on making decisions. There is also a lack of information being fielded about what the language will do, purpose, usefulness, etc.
Was This Post Helpful? 0
  • +
  • -

#5 BasketballFan589   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-October 18

Re: What language should I use for making a language?

Posted 26 October 2018 - 12:58 PM

View Postmodi123_1, on 26 October 2018 - 12:37 PM, said:

*shrug* I don't see a need to make a new language so the ball is in your court on making decisions. There is also a lack of information being fielded about what the language will do, purpose, usefulness, etc.


Sorry I am new to computer science and am starting classes this December. I think creating languages is an interesting topic because a simple language can be made just for a given application correct? And also I think systems software and applications software can be made with the same language if the systems software is just the application and the systems software can be the same as the application software. Ideally you would like versatility in terms of being applicable to different hardwares. But I want to make languages for specific programs. So the domain of the language would be the domain of the program.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14496
  • View blog
  • Posts: 58,109
  • Joined: 12-June 08

Re: What language should I use for making a language?

Posted 26 October 2018 - 01:06 PM

Quote

because a simple language can be made just for a given application correct?

That seems awfully wasteful of time, but to each their own.
Was This Post Helpful? 0
  • +
  • -

#7 BasketballFan589   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-October 18

Re: What language should I use for making a language?

Posted 26 October 2018 - 01:35 PM

Do you even need to use a language to invent a language? Can't you technically create a language from scratch?
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14496
  • View blog
  • Posts: 58,109
  • Joined: 12-June 08

Re: What language should I use for making a language?

Posted 26 October 2018 - 01:39 PM

In theory.. though at some point it all rolls back into assembly and then circuits.
Was This Post Helpful? 1
  • +
  • -

#9 sepp2k   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2662
  • View blog
  • Posts: 4,256
  • Joined: 21-June 11

Re: What language should I use for making a language?

Posted 28 October 2018 - 07:09 AM

View PostBasketballFan589, on 26 October 2018 - 06:20 PM, said:

What is the best language to use to invent a new language?


I'd second the article that modi linked: For compilers it doesn't really matter and for interpreters you'll probably want a language for which a reasonably efficient compiler exists. That said, if it's just for fun and/or learning that doesn't matter so much either, so you can really use any language you want in either case.

Note that when writing an interpreter, you can "cheat" certain features by making use of the implementation language's features. Like if you implement a garbage collected language in a garbage collected language, you could do it in such a way that you make use of the implementation language's GC rather than implementing your own (though that might defeat the purpose for a learning exercise). So that's another thing to consider when picking a language for an interpreter.

Really, I'd just go with whichever language you like best or, if you're feeling ambitious, a language that you've always wanted to learn.

View PostBasketballFan589, on 26 October 2018 - 08:33 PM, said:

View Postmodi123_1, on 26 October 2018 - 10:46 AM, said:

Compiled or interpreted?


What do you recommend?


That's really up to you and what you find more interesting and/or manageable. Interpreters are often easier to implement, but that does depend on many factors: compilers are easier the closer the source language is to the target language and interpreters are easier the closer the source language is to the implementation language (depending on how much you want to "cheat").

View PostBasketballFan589, on 26 October 2018 - 08:58 PM, said:

Sorry I am new to computer science and am starting classes this December.


Maybe you're biting off a bit more than you can chew right now then, but hey, if you're willing to put the work in, anything's possible.

Quote

I think creating languages is an interesting topic because a simple language can be made just for a given application correct?


Yes, those are called domain specific languages (DSLs).


View PostBasketballFan589, on 26 October 2018 - 09:35 PM, said:

Do you even need to use a language to invent a language? Can't you technically create a language from scratch?


That depends entirely on what exactly you mean. To design and specify a language, you don't need anything other than ideas, an understanding of syntax and semantics and a piece of paper, on which to write the specification. You don't even need a computer.

To implement a language, you'll need to write an interpreter or a compiler, which are computer programs. So as with any program, you'll need to write code for it. Technically you could write that code directly in machine language (again: just like with any other program you might write), but not only would that be much more difficult and less portable than using a higher-level language, it also doesn't necessarily fit the requirement since machine language is still a language (though that's a matter of definitions of course).
Was This Post Helpful? 2
  • +
  • -

#10 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12390
  • View blog
  • Posts: 45,519
  • Joined: 27-December 08

Re: What language should I use for making a language?

Posted 28 October 2018 - 09:43 AM

I suspect you're biting off more than you can chew at this point. Compilers is usually as much work as a solid operating systems class, and it requires a solid foundation in programming. You will want the equivalent of a first semester data structures course under your belt first.

Compilers has both a theoretical and an applied component. Here are some of my tutorials on the theoretical side:
https://www.dreaminc...ular-languages/
https://www.dreaminc...-free-grammars/

And blackcompe has some excellent tutorials on compilers:
https://www.dreaminc...xical-analysis/
https://www.dreaminc...art-ii-parsing/
Was This Post Helpful? 2
  • +
  • -

#11 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5309
  • View blog
  • Posts: 14,172
  • Joined: 18-April 07

Re: What language should I use for making a language?

Posted 28 October 2018 - 10:58 AM

I think modi123_1 and macosxnerd101 have said it best. Building a language is pretty tough for someone just starting out and even a challenge for experienced developers. They are also a lot of work to get the language to the point where it can do a lot of useful things. You might want to first try mastering a single existing language (maybe something like C programming) and then give it a shot.

Based on some of your responses I think you will benefit learning the difference between compiled vs interpreted because there is going to be a distinct reason to prefer one over the other. You will also come to realize that you wouldn't want to really create a language for a given application, but more along the lines of creating a language for a given problem domain. Again, based on the domain, it will point you more to either compiled vs interpreted.

If you are looking to get started with some great start projects, you can check out my project ideas thread... https://www.dreaminc...ect-ideas-list/ or if you need a little more I also offer a project idea ebook that contains tips and resources... https://www.codersle...mers-idea-book/

Hope this helps. :)

This post has been edited by Martyr2: 28 October 2018 - 11:01 AM

Was This Post Helpful? 3
  • +
  • -

#12 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11270
  • View blog
  • Posts: 19,311
  • Joined: 19-March 11

Re: What language should I use for making a language?

Posted 28 October 2018 - 07:04 PM

View PostBasketballFan589, on 26 October 2018 - 12:20 PM, said:

What is the best language to use to invent a new language?


Backus-Naur is pretty effective.
Was This Post Helpful? 4
  • +
  • -

#13 hexagod   User is offline

  • D.I.C Regular

Reputation: 11
  • View blog
  • Posts: 354
  • Joined: 29-October 16

Re: What language should I use for making a language?

Posted 05 November 2018 - 08:59 AM

@BasketballFan589 You're just starting out in Comp Science and you want to make a programming language? That is probably not a good idea. It's not that I'm poo pooing your dreams... but from a practical standpoint you're going to end up with headaches it will be years before you would get fruitful results from your labor. If I were you I would look into integrated circuit design, if you want to get into the nitty gritty.

You should take advantage of the existing languages. It is amazing the amount of human blood sweat and tears that have gone into modern object oriented IDEs and languages. My favorites are VC++, C#, XAML, PowerShell; I don't know java, but if I did, I probably would have a job programming right now (instead of being freelance lol). Java is a very economical language both in terms of popularity, universality, and ease of finding work.

If I still haven't convinced you, I think assembly is the language that processors and ICs use, so that's how you roll your own. C++ could be used to make a high level language.

gl:hf :offtopic: :happybday:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1