• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Nathan2222_old

Just another thought (designing a fast but powerful language)

77 posts in this topic

I wanted to ask this in a previous thread but I thought it needed it's topic.
Would it be possible to make a compiled language as fast as c and c++, multi paradigm like c++, less complex than them both and can be used like in really complex situations like in making an OS/game engine/IDE etc.
Just wondering (may have mistakes above).

Thanks.

0

Share this post


Link to post
Share on other sites

//EDIT: Please try to give your topics more meaningful titles; "Just another thought" tells a potential reader absolutely nothing about what they made find, so I've edited the title of this topic to be more descriptive.


thanks for changing the title.
1

Share this post


Link to post
Share on other sites

Java and D seem a lot like C++ (java involves more typing) and Go like C.

 
Please don't ever compare Java to C++ again.  It hurts me deep in my soul. :p
;)
0

Share this post


Link to post
Share on other sites

Absolutely.
 
Whether or not any existing languages (such as the above-linked go and D) already meet most of those requirements is pretty subjective; we can obviously measure execution speed for code solving similar tasks, but what qualifies as "less complex" and what qualifies as "really complex situations" really depend on the skills and preferences of the programmer.
 
If you were thinking about starting such a project from scratch you should expect it to be very difficult, to take a lot of work, and to take quite some time to have anything workable; creating your own language (even if it's just a toy language) is however an excellent learning experience that's well worth undertaking at some point if you're interested in the low-level details of programming.

i probably will undertake a project like this. I just feel like some things are more misunderstandable than they should be and there should be a better way.
Yersterday, i read an article saying that ruby/python programs involve 5x less lines than c and c++ programs. What does this mean?
0

Share this post


Link to post
Share on other sites

Of course it would be possible but weather or not it is feasible or even productive is another matter.

2

Share this post


Link to post
Share on other sites

Of course it would be possible but weather or not it is feasible or even productive is another matter.

by reducing the number of lines required to do something.
Which is why i asked about what 5x less means (i don't want to misunderstand it).
For instance, gta iv contained about 50,000 which included lines and comments. What if the need for the comments (not all) where reduced because you could tell what a piece of code does by taking a glance at it (even by some beginners) and some extra code and extra typing will not be needed thereby enabling you do things faster, increasing productivity.
You *could* reduce the line count by more than 10,000 (maybe).
0

Share this post


Link to post
Share on other sites

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 

Edited by fir
0

Share this post


Link to post
Share on other sites

Sure, the infamous LOC metric. Read here for a more recent thread about.

yes i have been seeing the lines of code stuff lately.
I personally don't use comments but as for whitespaces and newlines, they're everywhere.
If code isn't clear and readable, then it's not useful. How hard can it be to press spacebar or enter ? You don't really notice it while pressing.
What i want is a language that is easy to understand, make readable programs with as fast as possible (with less or more lines depending on the user) and can be used in many scenarios. I'ld rather write 50 lines of code with white space and without comments than 50 without whitespace and with comments everywhere.
I saw a program that had a total of about 784,000 LOC and about 264,000 were spaces while about 128,000 were comments so that leaves about less than 390,000 executable LOC. It's the 390,000 i'm focused on (if i wrote that program, it'll probably way more spaces).
0

Share this post


Link to post
Share on other sites
I would encourage you to have a look at some functional programming languages, SML, Haskell, Ocaml and Erlang.

I am by no means an expert in any of these languages but due to the high level design I find you can reduce your LOC dramatically.

I don't know how much these languages are suited for game programming or what tools are available but if you like a challenge and to expand your programming skills I highly recommend you delve into one.
0

Share this post


Link to post
Share on other sites

I would encourage you to have a look at some functional programming languages, SML, Haskell, Ocaml and Erlang.
I am by no means an expert in any of these languages but due to the high level design I find you can reduce your LOC dramatically.
I don't know how much these languages are suited for game programming or what tools are available but if you like a challenge and to expand your programming skills I highly recommend you delve into one.

I've only heard of haskell.
I'm going to be learning assembly later on.
0

Share this post


Link to post
Share on other sites

I am by no means an expert in any of these languages but due to the high level design I find you can reduce your LOC dramatically.

 

It depends on what you're doing.  If you're trying to perform mathematical expressions on a list of numbers, a functional language will most likely beat a procedural language hands down (in terms of LOC).  I'd hate to try to write an advanced application moreless verbosely though, as it's just not what they're designed for.

Edited by LennyLen
0

Share this post


Link to post
Share on other sites

 

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.

1

Share this post


Link to post
Share on other sites

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 . . .
that's what i mean. It's not the whitespace, it is just, shorter.
What do you mean by functions disappear etc.?
0

Share this post


Link to post
Share on other sites
After reading the wikipedia article on functional programming, i see that that's where c++ got recursivity from and functional programming seems to be concerned with only mathematics.
-4

Share this post


Link to post
Share on other sites

What do you mean by functions disappear etc.?

 

Imagine I had the following function in C++:



bool SomeElementIsTrue(std::vector<bool> vec) {

    for(std::vector<bool>::iterator it = vec.begin() ; it != vec.end(); ++it)
        if (*it == true)  return true;

    return false;

}

If I converted my program to Python, I can remove the entire function, and use the built-in 'any' function. 

Edited by LennyLen
1

Share this post


Link to post
Share on other sites

What do you mean by functions disappear etc.?


Imagine I had the following function in C++:
bool SomeElementIsTrue(std::vector<bool> vec) {    for(std::vector<bool>::iterator it = vec.begin() ; it != vec.end(); ++it)        if (it == true)  return true;    return false;}
If I converted my program to Python, I can remove the entire function, and use the built-in 'any' function.
that is a lot of line difference :o.
Instead of that, you use:

any()
-6 lines for you and -7 for me.
That is exactly what i meant by reducing the amount of code needed to be typed to do something.
0

Share this post


Link to post
Share on other sites

What do you mean by functions disappear etc.?

 
Imagine I had the following function in C++:
bool SomeElementIsTrue(std::vector<bool> vec) {

    for(std::vector<bool>::iterator it = vec.begin() ; it != vec.end(); ++it)
        if (it == true)  return true;

    return false;

}
If I converted my program to Python, I can remove the entire function, and use the built-in 'any' function.


If I wrote that program in C++, I could remove the entire function and use the library `find' function, or just provide a one-line implementation of the function:

bool any(std::vector<bool> const &v) {
  return std::find(v.begin(), v.end(), true) != v.end();
}
Perhaps you didn't mean to compare an iterator and a boolean constant... smile.png
0

Share this post


Link to post
Share on other sites

What do you mean by functions disappear etc.?

 Imagine I had the following function in C++:
bool SomeElementIsTrue(std::vector<bool> vec) {

    for(std::vector<bool>::iterator it = vec.begin() ; it != vec.end(); ++it)
        if (it == true)  return true;

    return false;

}
If I converted my program to Python, I can remove the entire function, and use the built-in 'any' function.
If I wrote that program in C++, I could remove the entire function and use the library `find' function, or just provide a one-line implementation of the function:
bool any(std::vector<bool> const &v) {
  return std::find(v.begin(), v.end(), true) != v.end();
}
Perhaps you didn't mean to compare an iterator and a boolean constant... :)

3 lines. Yes, the {} is counted.
-5

Share this post


Link to post
Share on other sites
Also, if you insist on making things as short as possible, you'll end up with a programming language that looks like ASCII noise. Take a look at J for an example of a language that goes too far in that direction.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0