Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is creating a scripting language for my own personal learning experience worth it?

The reason I ask is that there are so many programming languages available already, I know mine will never have any actual use other than providing a good learning experience. I do, however, see drawbacks with just trying to make a scripting language as a learning experience: it will take a lot of time and effort in which I could be doing something more "productive."

Would creating a programming language (including writing drafts of its intended purpose, syntax, philosophy, interpreter, etc) be worth the time, effort and learning experience? Or are there other projects I could benefit more from?

share|improve this question
3  
Another option is to implement an existing language. I slowly developed an ECMAScript dialect called Machete over more than a year and learned quite a bit. –  ChaosPandion Aug 16 '11 at 23:51
    
Interesting, I hadn't thought of that. –  Ivan Aug 16 '11 at 23:53
2  
1) Learn this... www1.idc.ac.il/tecs 2) and this... mitpress.mit.edu/sicp –  Joe Internet Aug 17 '11 at 2:34
    
you could also consider contributing to existing projects v8, SpiderMonkey or Python –  good_computer Aug 17 '11 at 5:57
3  
IMHO, the best way to learn new programming languages is to implement compilers for them (or at least for significant subsets of original languages). So, yes, it is indeed a useful learning experience. –  SK-logic Aug 17 '11 at 6:48
show 5 more comments

5 Answers

up vote 12 down vote accepted

Build Up your Skills AND your Portfolio

In my opinion that would be a very good learning experience as it will:

  • force you to look under the hood,
  • guide you to learn how things are internally done,
  • encourage you to look at and compare other implementations,
  • keep your algorithmics skills up to speed,
  • make you code (and hopefully document) a lot, which isn't a bad either,
  • give you a significant project and codebase you could share online for all to see, for:
    • personal enjoyment and gratification,
    • showcasing your skills to potential employers,
    • communicate and exchange with peers interested in the same area,
    • potentially let it grow into something more...

So I do see this as produce, useful, and overall "worth it".

Get Started

Now you can use different approaches, depending on how much time you plan on spending on this...:

  • If you have a limited time-frame, I'd say dive in and code the thing.
  • If you have a wider timeframe, then you could indeed go the long-winded way and write specs, tutorials, manual, etc...

Start Small

I would rather recommend you to start small. No one has ever, that I know of, written directly an awesome language just like that. You stumble and fall, and fail, and fail and fail. Then you succeed, in that it works but still sucks, so you start over once more. And you add new features and it's finally getting cool, but suddenly you realize that there's a fundamental concept that you screwed up at the beginning. So you start over once more...

Seems very educational to me.

Go ahead (and share the link with us).

Small, as in "short"

But again, I'd recommend you start small. Don't be afraid if people say it's going to take a lot of code and time. Not necessarily, if you don't aim for a complicated language. Alan Kay and other Xerox PARC engineers allegedly developed an early version of Smalltalk that fit on a single sheet of paper, as an objective for terseness (read Xerox PARC: Dealers of Lightning for details about the history of the PARC). Seems a good, educational and constrained enough approach (as long as it doesn't sacrifice readability).

Small, as in "constrained"

You don't need to support right away an advanced type system, higher-order funcitons and a mix of 42 different paradigms. It could just be a mathematical expression language.

Re-use (and Peek at) Other's Knowledge

You may also want to have a look at tools that are used to write languages from scratch. You can re-implement everything youself, but maybe it's also worth looking at existing lexers and parser generators, for instance.

And obviously, you may want to read up on compiler construction at large.


Now, if we modify your question to be "would it be THE MOST productive use of your time?" it becomes an entirely different issue :)

There are tons of other learning projects you could tackle, and that would train and showcase your skills equally well, if not better. It depends what you want to aim for.

share|improve this answer
2  
+1 for "Then you succeed, in that it works but still sucks" –  Ivan Aug 17 '11 at 0:25
1  
@Ivan: Thanks :) That's probably another good part of the learning experience: introspection, humility and perseverance! –  haylem Aug 17 '11 at 0:28
1  
I agree with haylem. The amount you will learn about programming in geneneral, how languages work, different methods of implementing things will be well worth it. Yes you will probably be the only one who ever sees it but it will become your little pet project you work on to improve yourself. –  RJay75 Aug 17 '11 at 13:55
add comment

It would take a while to do. Do you plan on maintaining it?

Would creating a programming language (including writing drafts of its intended purpose, syntax, philosophy, interpreter, etc) be worth the time, effort and learning experience? Or are there other projects I could benefit more from?

I'm assuming your financial status is not infinite, so I would say that it is not worth the time. You can spend your time on other useful projects that can make you money. Keep in mind this may not be the answer you are looking for, but from a logical stand point, I would say that your programming language may not be the right project at the moment. I would consider it if you were a retired computer scientist, and felt the need to contribute to the industry. It seems that you have a strong passion for programming, and that is great. But, building an entire new scripting language? That will be an extremely long project. In that time you could have built many applications that you can toss into your portfolio. I think the question is: Do I have the time and/or an open priority in my life that will enable me to create a new programming language from scratch?

share|improve this answer
2  
I don't know... one big labor of love trumps twenty throw away apps that might make you one-hundred bucks each. –  ChaosPandion Aug 17 '11 at 0:00
    
Implementing domain specific languages might actually speed up a development of a practical project significantly. So it could be quite rewarding financially as well as aesthetically pleasing. –  SK-logic Aug 17 '11 at 6:51
1  
Some people create things because they like to create things...not because the said act of creation will net them some cash. –  Jetti Aug 17 '11 at 13:51
    
@Jetti. Yes I know. That is why I said this answer might not be the one your looking for, and I could tell you have a passion for programming. I appreciate your input though, as I was waiting for someone to say something like what you have said about this answer. –  Ryan Aug 17 '11 at 23:50
    
@Ryan - sorry I missed that part. –  Jetti Aug 18 '11 at 1:13
add comment

My advice to you is

Do not reinvent the wheel

The inspiration for this idiomatic metaphor lies in the fact that the wheel is the archetype of human ingenuity, both by virtue of the added power and flexibility it affords its users, and also in the ancient origins which allow it to underlie much, if not all, of modern technology. As it has already been invented, and is not considered to have any operational flaws, an attempt to reinvent it would be pointless and add no value to the object, and would be a waste of time, diverting the investigator's resources from possibly more worthy goals which his or her skills could advance more substantially.

You should ask yourself:

  • Why do you need to create script? Is the existing script out there is not good enough?
  • Will you maintain and publish it, and you are confident that your script will be used by other programmers? If your answer is no, don't do it.

I understand that you want to have more learning experience and for that reason personally I think that creating framework will give you more learning experience and with the bonus that you/your team/community can reuse it later, than creating a script.

And this xkcd comic is a bit relevant, just change "standards" to "language" also:

enter image description here

share|improve this answer
    
-1, he clearly said this would be for a personal learning experience. –  GrandmasterB Aug 17 '11 at 3:44
    
Just want to be frank that creating script won't give real personal learning experience and benefit, to himself and the community. I also added my answer that creating framework will actually benefit him and the community more. I don't mind to get more down vote, if you feel that it's not true. –  Rudy Aug 17 '11 at 4:31
    
Yep, you're right - no freshman programmer shall ever write his first "Hello, World!" - after all, it'd be much better to just download an existing one. And what is "framework" in this context? –  SK-logic Aug 17 '11 at 6:53
    
@SK-Logic, Framework in way like Spring framework/Hibernate etc. Your example here is not really correct. Please by all means to write your Hello World using any existing language, but why need to create your own language just to write "Hello World"? ( Other to fulfill your own ego? ) –  Rudy Aug 17 '11 at 8:16
3  
@Rudy, implementing a compiler or interpreter is such a trivial and basic skill that is is quite close to "Hello, World!". That's why it is mandatory in any decent CS course. And, despite being trivial, this task teaches a number of very useful skills, applicable in practice in almost any area. Needless to mention that implementing DSLs is extremely important (mind you - that Hibernate thingy you've mentioned is a DSL, and there is a number of embedded interpreters and compilers in it, some of which are quite poorly implemented). –  SK-logic Aug 17 '11 at 8:55
show 1 more comment

Designing and implementing a (toy but complete) programming language was actually one of the (required?) exercises in one of my upper division CS classes (either the compiler class or the programming language survey, I forget which...)

So at least one CS professor thought so.

You will end up with a much better appreciation for all those "quirks" that other languages have.

share|improve this answer
add comment

I say go ahead.

Implementing a programming language covers a broad range of topics, and you'll learn a lot about how things work under the hood. You'll probably live through a half-dozen or so failed attempts, but the learning experience is invaluable.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.