Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm doing a set of programming lectures, these are less about the functional programming aspect, and more about the philosophy of programming and to inspire teens to look into programming.

So it would be fun to have a functional programming language that had very few "commands", so that I can show them something simple that does complex things.

Yes I could make my own "pseudocode language", with a simple "interpreter" in C#, (which is my plan), but it would be fun to have something real with 15-ish "keywords" that actually compile.

Anyone have any quick answers?
Posted

Well ... LISP has NO keywords!

It has a syntax and lots of predefined functions!
 
Share this answer
 
v2
Comments
Frank R. Haugen 12-Feb-14 13:36pm    
I might have assumed "keyword" meant the same to others as it did to the guys I've been working with. From my mental "definition" of a "keyword" is any word that 'does' something; this include functions, operators, etc.

I probably should get around to make a "KAREL the Robot" in C#, that would fit my parameters :P

tnx anywasy :-)
Sergey Alexandrovich Kryukov 12-Feb-14 17:18pm    
Great point. And this is not the only case. My 5.
It is hard to beat. The only possibility is to find or devise some programming language which has negative number of keywords. I would invite OP to work at such language. I'm pretty much sure it's quite possible. :-)
—SA
Matt T Heffron 12-Feb-14 18:33pm    
Just how would you define "negative number of keywords" ??
Sergey Alexandrovich Kryukov 12-Feb-14 19:17pm    
I expected this question, but hoped that you would guess how...
However, if this cause some doubt, my explanation deserves a separate answer. Please see Solution 3. :-)
—SA
Sergey Alexandrovich Kryukov 12-Feb-14 17:22pm    
I actually got a different idea of the "language without keywords". Please see Solution 2.
—SA
Matt T Heffron asked:
Just how would you define "negative number of keywords" ??
I expected this question, but hoped that you would guess how. Of course.

The concept should be related to the idea of a "custom keyword". Are you getting the idea already?
I don't want to discuss what a "custom keyword" may mean, it could be probably introduced in different ways. It's important to understand that it should not be a name of the type, object, method, nothing like a usual name defined by a developer, it should really be a "keyword". It should be defined by the user, extend the language, and be usable since that moment of time. For now, let's just assume that such concept is introduced.

So, in particular, if some language, originally, before customization, has zero keywords, it means the following: the user can customize it, for example, by adding one keyword which can further be used. Now, we can devise a language that has, say, −5 keywords. This would be the language with the following property: to customize the language to have just one usable keyword, the customer will need to add 6 keywords; to get 5 usable keywords, the customer would need to add 10, and so on.

Provided the concept of the "custom keyword" is already available, the implementation of the language with negative number of keywords would be really quite simple. :-)

—SA
 
Share this answer
 
v6
Comments
Frank R. Haugen 13-Feb-14 10:35am    
Now that's fascinating!

Now just reflecting on this, in terms of teaching, this would be an infinitely powerful tool.

I might also suggest that logic gate "programming" is an effective but boring way to do the simple stuff, and then make it more complex by "leveling up" the abstraction level step by step, (some cheating involved)
Sergey Alexandrovich Kryukov 13-Feb-14 13:21pm    
I am sure you would be able to do such things.
Good luck, call again.
—SA
I still appreciate Solution 1. Please see my comments to is. Another, "cleaner" example of the languages with zero number of keywords would be the language which only has operators. You cannot call operator a "word", can you? :-)
For example: http://en.wikipedia.org/wiki/Brainfuck[^].

—SA
 
Share this answer
 
Comments
Richard C Bishop 12-Feb-14 17:30pm    
That hurts my brain.
Sergey Alexandrovich Kryukov 12-Feb-14 17:45pm    
We have not so very old saying: "Head cannot ache, because this is bone!". :-)
—SA
Richard C Bishop 12-Feb-14 17:47pm    
LOL, that reminds me of "Confucious" sayings:

Confucious say, "Man who stand on toilet, is high on pot".
Sergey Alexandrovich Kryukov 12-Feb-14 17:49pm    
Great one... :-)
—SA
Richard C Bishop 12-Feb-14 17:58pm    
Thank you, that is my favorite one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900