Just another thought (designing a fast but powerful language)

Started by
76 comments, last by Aardvajk 10 years, 2 months ago


In my thoughts, i've created a google chrome style browser with less than 300 lines of code. It involves some sort of AI and the language uses specify a lot.

… and if you could actually do that sort of stuff in the real world instead of in your thoughts, Google (and lots of other companies) would throw so much money at you that you could end all poverty and still have more money than you could ever spend.

If we're going to go all dreamy, I can think of a machine that looks like a really cool hat that you can wear, and makes every game idea you'll ever think of magically appear fully created with the best graphics and gameplay ever. You don't even have to type a single line of code. How can any other invention ever beat that for game development? It'll use some clever neuro-science or something, and you have to focus on your idea for 10 seconds.

There is a world of difference between "I've got this fantastical magical thought-concept for something - I'm sure it's going to be awesome" and "This is a fully-functioning realization of an idea".

The former is easy. Ideas are generally easy.

Execution is hard.

Hello to all my stalkers.

Advertisement

In my thoughts, i've created a google chrome style browser with less than 300 lines of code. It involves some sort of AI and the language uses specify a lot.

… and if you could actually do that sort of stuff in the real world instead of in your thoughts, Google (and lots of other companies) would throw so much money at you that you could end all poverty and still have more money than you could ever spend.

If we're going to go all dreamy, I can think of a machine that looks like a really cool hat that you can wear, and makes every game idea you'll ever think of magically appear fully created with the best graphics and gameplay ever. You don't even have to type a single line of code. How can any other invention ever beat that for game development? It'll use some clever neuro-science or something, and you have to focus on your idea for 10 seconds.

There is a world of difference between "I've got this fantastical magical thought-concept for something - I'm sure it's going to be awesome" and "This is a fully-functioning realization of an idea".
The former is easy. Ideas are generally easy.
Execution is hard.
it just seems right and mine involves coding.
I need to think more.
I heard never throw away an idea.

UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy


I need to think more.

There is an old saying I've been told for years that I think applies nicely to that: "Think less, code more."


I heard never throw away an idea.

That is true. Every game idea I have had, I have wrote into a series of notebooks. If you don't have them, get notebooks to write the idea in or type up the idea, print it out, and then store them in a binder. Above all else, code, always code, even if you just do tests for ideas, you must always code something as it will help you improve.

I need to think more.

There is an old saying I've been told for years that I think applies nicely to that: "Think less, code more."

I heard never throw away an idea.

That is true. Every game idea I have had, I have wrote into a series of notebooks. If you don't have them, get notebooks to write the idea in or type up the idea, print it out, and then store them in a binder. Above all else, code, always code, even if you just do tests for ideas, you must always code something as it will help you improve.
I will. I have several ideas in several notebooks, i don't really like typing down my ideas.

UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy

Are you planning to write a compiler for this language you have in mind?

In my thoughts, i've created a google chrome style browser with less than 300 lines of code. It involves some sort of AI and the language uses specify a lot.

specify object:specify object function{}
I can't seem to think of console programs in the language. Only GUI programs.

Are you planning to write a compiler for this language you have in mind?

Yeah. An ide.
Won't i have to?

UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy

Yersterday, i read an article saying that ruby/python programs involve 5x less lines than c and c++ programs. What does this mean?

dont think so, I was not using python to much but this would

meen (if the function of your code will stay the same and they

if they doing something nontrivial but real code - stay the same)

that every of such function will be compressed 5X of 4X

- i dont see it - it will be about the same [esp if you will remove the blank lines and move code like

void f() {

if(a==0) {

b++; } }

(years ago i was using thic convention, this is not so bad imo)

what else python make to short sources compared to c ?

(maybe something but it would be imo more like 20% shorter not 5X

You do realize that when we say that Python code is shorter than e.g. C code we're not talking about removing the curly braces and a few comments, right? We're talking about the high-level structure of the code - Python is typically more expressive in less code, because it has a lot of stuff built-in (and cross-platform, for the most part), it's designed for short and concise syntax so that you don't have to implement all the stuff you need manually or use an external library (if even possible, like syntactic sugar).


(if the function of your code will stay the same and they
if they doing something nontrivial but real code - stay the same

That's the point - the code doesn't stay the same. It becomes shorter as a lot of the low-level complexity you have to deal with in C or C++ for instance is handled by the language and the runtime itself. Functions disappear because they become built-in, paragraphs of code become shorter because you don't need many lines to declare, initialize and populate a dictionary (key-value store) from a file, you can do it in one, you don't need to formally define complex object relations and dependencies since you have duck typing, variables are automatically freed, nontrivial command-line parsing is built-in and you don't have to go dig up a library on the internet and learn how to use it (more or less everyone uses argparse), big integers are built-in, you can even run Python code dynamically from existing code, etc, etc...

If you think Python is just C minus the curly braces then you clearly have never used it. It has its failings and doesn't work for everything (writing a large business application would probably get messy, and it has its warts) but when you use it - or Ruby, by the way, everything I said above almost certainly applies to Ruby even though I've never used it - for what it's meant for, the resulting code is surprisingly short and fluent.

well, i dont know (i used a python to wrote a simple mandelbrot set viewer a couple of years ago and that is all my knowledge of python)

i think 90% of c programs length are user defined labels, the rest is keywords (mostly return float double int) and a dust of symbols (overpresent in c imo) [your very right about this that declaration

lines consume space in c thats good point]

one could move some code lines by makin things built-in as you said

but could you give some some examples for things that are biult in

in ptyhon and canot by shortened in c by moving them to library and

just use library (It is maybe possible but i dont see it because idont

know python to this extent)

after all i still doubt if python can shorten sources even 3 times not to mention 5 times - the main fail of c is maybe its overuse of symbols here


one could move some code lines by makin things built-in as you said
but could you give some some examples for things that are biult in
in ptyhon and canot by shortened in c by moving them to library and
just use library (It is maybe possible but i dont see it because idont
know python to this extent)

You can move the entirety of your program into a library and call it in a single line from your main function. Does that make it the shortest program ever?

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


one could move some code lines by makin things built-in as you said
but could you give some some examples for things that are biult in
in ptyhon and canot by shortened in c by moving them to library and
just use library (It is maybe possible but i dont see it because idont
know python to this extent)

You can move the entirety of your program into a library and call it in a single line from your main function. Does that make it the shortest program ever?

you could also built-in your program in python so it wold be 1:1

python wouldnt be 5 times shorter or it will be?

Im saing that defining things and moving them away of the code

should be excluded from comparison - I mean if you confront some

python builtins compare tham against c with library

except when you give examples of things that python could really short and this would be hard to achive in c + lib (Im just interested in examples on this)

Are you sure what you want/need is a new language, and not just a nice framework/library for whatever task it is you want to achieve?

There is no language that is best on everything (or produce the least amount of lines for everything), you have to define what you want to do first.

Without a task, the discussion is rather pointless.

This topic is closed to new replies.

Advertisement