My new language is for fast protyping. I call it the skeleton langauge. Suitable for this time of year!
Here is some pseudo-javascript:
var x=3;
var y=5;
var z=x+y;
var s=[1,2,3,4,5];
for(var k=1;k<=10;k++){
console.log( "Square of "+k+" is "+(k*k)+"\n");
if (k%2==0){
console.log(k+" is even\n");
}
}
function sum(x,y){
return x+y
}
t = sum(3,5)
class Animal{
var height;
Animal(h){
height=h;
}
function weight(){
return Math.pow(height,3);
}
}
In my new language this becomes (looks better without the line numbers):
x 3
y 5
z x+y
s [1 2 3 4 5]
k 1 10
@ "Square of " k " is " k*k "\n"
k%2=0
@ k " is even\n"
sum x y->z
z x+y
t sum 3 5
Animal h :
height h
weight -> z
z height^3
Mainly it involves just removing as much extraneous characters as possible. It would be good as a scripting language for fast prototyping. Not really sure the best way to do while loops or more complicated for loops. To pass a function as an argument you might need to wrap it in brackets like this: (Math.sin) so it doesnât execute.
Oh yeah.
But mine does away with 10% more characters! All that time you spend typing the = sign. And you can save vital seconds by not having to type in âforâ, âinâ and âifâ.
Iâll call mine âblack coffeescriptâ. Itâs like coffee but without the added extras.
I think youâll find you are actually increasing the mental load on the developer here, not reducing it. Iâm willing to bet it will take most developers longer to read and write code without all of the extra symbols.
Plus I would think a language where your brain is forced to fill in the blanks more would lead you to become mentally tired faster working with it than a language where you have additional symbols to indicate meaning.
Itâs not really designed for readability more for writability to write really really quick pieces of code. Such as printing out the first 10 square numbers.
But actually with the indents, itâs not too hard to see whatâs meant to be a for statement or an if statment. Well maybe a little! Here is the fibonacci code:
fib n->m
n < 2
m n
else
m fib (n - 1) + fib (n - 2)
(couldnât work out a nice way to get rid of the else statement :() I suppose one could write:
fib n->m
m n<2 ? n : fib (n - 1) + fib (n - 2)
in this case. Well anyway it still needs work. In fact one could write this as a oneline function just as:
Is this a joke or something? Because I donât get it.
There is a reason why we abstracted away from ASM, why BASIC isnât the leading programming language anymore and why PHP became the leading backend script language in the '90-ies and not Perl.
Well the idea is, you think to yourself. What are the first 10 cube numbers? I have no time to lose. Then you just type:
x 1 10
@ x*x*x
And your done in 12 keystrokes. Which usually would have taken you 24. You probably donât even need the â@â symbol as suggested. A single value could just be printed out. Saving you another valuable second. Iâm trying to cut it down even further.
Thatâs where youâre wrong and you will realize it as soon as you start to write something serious in your âbrand newâ language.
What people donât get when they start to code that it is not the typing what takes the time.
Especially not in the golden era of IDEs. But this comes with experience, if you code enough you will realize that analyzing the situation, the code paths, the existing logic, the ways you can solve a particular problem takes more time than type 2-5 characters and hit enter to give the IDE the chance to do the typing for you.
Itâs not for âseriousâ things. Itâs for fast calculations and prototyping. The fastest possible way to get from an idea in your head to the result.
Thanks man!
Here would be the Hello World program in this language:
@ "Hello World!"
Hmmm⌠having thought about it. Having a space instead of an = doesnât technically save any characters. But I think it is faster because the space bar is easier to find on the keyboard.
Iâve just been having a look at CoffeeScript. Itâs a pretty cool language. I might even say better than Python. Wouldnât mind using this a scripting language in Unity. I wonder if this is possible.
I suppose one would have to make a program that converts it to c#.
While I think its rather cool you made this, I also think its not really âscalableâ. As others have said you would get tired quicker and I like to think about programming as âcan I do this when its 3am and I have not slept for 3 days?â.
This language is great if you are at full mental capacity but what about when your tired, struggling to concentrate due to coworker noise etc? I imagine it will get tiresome as there is a reason something like this hasnt materialised - people have made similar efforts in the past but they never catch on for exactly those reasons
And thats before you start to think about it from a code review point of view. A lot of what you call time saving, could be seen as ambiguity, which just lengthens how long it takes to code review with another member of staff etc. âIm not sure, do you mean this or this? I read it as X but it could also be Y or Zâ sort of thing
C# is a pretty tight langauge as it is. Problems arise when people use comments, bad naming, brackets, explicit type declarations instead of âvarâ. etc.
There are too easy to write unmaintainable code in C#
@TheGaul whipe is cool inventing stuff, your sample fails at very first post.
Code based on indentations, without brackets can become quickly very messy and hard to maintain.
Just look you very first example class. It uses double indentation. Where really should be single indentation. So you start confusing even yourself at very start.