开发者

Can you help me think of problems for my programming language? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 9 years ago.

Improve this question

I've created an experimental toy programming language with a (now) working interpreter. It is turing-complete and has a pretty low-level instruction set.

Even if everything takes four to six times more code and time than in PHP, Python or Ruby I still开发者_StackOverflow love programming all kinds of things in it.

So I got the "basic" things that are written in many languages working:

  • Hello World
  • Input -> Output
  • Countdowns (not as easy as you think as there are no loops)
  • Factorials
  • Array emulation
  • 99 Bottles of Beer (simple, wrong inflection)
  • 99 Bottles of Beer (canonical)
  • Collatz conjecture

  • Quine (that was a fun one!)

  • Brainf*ck interpreter (To proof turing-completeness, made me happy)

So I implemented all of the above examples because:

  • They all used many different aspects of the language
  • They are pretty interesting
  • They don't take hours to write

Now my problem is: I've run out of ideas! I don't find any more examples of what problems I could solve using my language.

  • Do you have any programming problems which fit into some of the criteria above for me to work out?


Try things from Project Euler - these puzzles are always good for testing out new languages.


Implement a compiler (to any language you know) for your language, in the language itself.


try implementing various types sorts and searches, using arrays and then pointers.

Sorting Algorithm
Search Algorithm


Something recursive perhaps?

I've got two toy languages of my own. I've done some of what you described. Another thing I did was try to print out the Fibonacci Sequence. One more thing you can do is write a program that checks to see if a number is prime.

Do you have a link to your language? I'd like to check it out!


Rather than more things to do in that toy language, I'd think hard about implementing a language that's somewhat more complete and useful. In particular, spend some time thinking about the things you dislike about other languages, and see if you can't improve them.


You could consider implementing the tests for the "Shootout".


This could be a good application of the items you find at http://codekata.pragprog.com/2007/01/code_kata_backg.html#more


After you finish with writing a bunch of short applications it might be interesting to write a simple server. A lot of topics come up with servers that would help you identify if your language can address things like UDP/TCP, threading, queues, security, etc.


Check out the RubyQuiz site. Plenty of silly little things you could do to test out your language.


You could add support for arbitrary precision arithmetic by either writing it as a module for your language in your language or as a first class language construct.


Try to implement something real. For example web based mail client. Do just abstract task is boaring.


How about canonical data structures and algorithms? Or semi-canonical? For intance, I always wanted to implement associative array based on radix trie. That looks fun.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜