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.

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

Posted 26 October 2018 - 12:58 PM

modi123_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.

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

Posted 28 October 2018 - 07:09 AM

BasketballFan589, 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.

BasketballFan589, on 26 October 2018 - 08:33 PM, said:

modi123_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").

BasketballFan589, 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).

BasketballFan589, 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).

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.

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.

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.