Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 14th, 2005, 10:59 PM   #1
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
New Language Ideas

If someone were to create a brand new programming language, what ideas would you want to go into it? Are there features of other languages that you would want in it? Are there features that you thought would be great in another language, and that would be good in a new one?

Be as detailed as possible, and mention any ideas you'd like within bounds, from any other language, or brand new ideas never seen before. Let's make the best language ever!
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}

Last edited by iignotus; May 14th, 2005 at 11:06 PM.
iignotus is offline   Reply With Quote
Old May 14th, 2005, 11:35 PM   #2
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
something I would like is to have certain functions be declared as "value only" or something to that effect. These functions would treat all their pointer/reference arguments as const, and would not modify any statically-allocated variables. They couldn't be declared void, because that would be pointless.

These value only functions would also be able to be evaluated at compile-time if they were passed constant arguments! That way you could have something like this:
value int square(int i)
{
       return i*i;
}
const int squares[10];
for(int i = 0;i<10;i++)
{
        squares[i] = square(i);
}
the array "squares" should be completely evaluated and filled in at compile time. I don't know if good compilers can do this already. If they can, ignore me :-P
uman is offline   Reply With Quote
Old May 15th, 2005, 12:29 AM   #3
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
a function with optional parameters would be nice, something like this:
void person(string name, opt int age, opt int weight, opt string address)
{...}
this function will only need a name as parameter while the rest are optional:
person("John");   // this is ok
person("John",,180); //name = john, weight = 180
OpenLoop is offline   Reply With Quote
Old May 15th, 2005, 11:30 AM   #4
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Quote:
Originally Posted by OpenLoop
a function with optional parameters would be nice, something like this:
void person(string name, opt int age, opt int weight, opt string address)
{...}
this function will only need a name as parameter while the rest are optional:
person("John");   // this is ok
person("John",,180); //name = john, weight = 180
You mean like a better version of function overloading?
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old May 15th, 2005, 12:45 PM   #5
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
Quote:
Originally Posted by iignotus
You mean like a better version of function overloading?
exactly. i don't want to write 20 definitions for a function to make it accept various sets of parameter.
I know there are ways arround this but having this feature would be neat

Last edited by OpenLoop; May 15th, 2005 at 12:47 PM.
OpenLoop is offline   Reply With Quote
Old May 15th, 2005, 1:03 PM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8 Ooble is on a distinguished road
Most languages (such as Python) support optional parameters like this:
(pseudocode)
function MyFunction (arg1, arg2 = "x", arg3, arg4 = 0):
    ...
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 15th, 2005, 11:09 PM   #7
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
I would create something like esperanto
__________________
Clifford Matthew Roche &lt;geek@cliffordroche.com&gt;
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old May 16th, 2005, 2:25 AM   #8
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 5 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
a program which forces a certain notation style (eg curly braces in a specifi place tabbing )
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old May 16th, 2005, 8:43 AM   #9
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,453
Rep Power: 7 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Auto optimization for speed and resource management, extensive self-debugging, suggestive corrections, code repository, etc.

There was something pretty cool I saw in one of my magz. The "programmer" typed in the program "to the computer" as if it was having a conversation. Through logic deduction of what the "programmer" entered, the program generated source code.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old May 16th, 2005, 10:37 AM   #10
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8 Ooble is on a distinguished road
What was that language, IR?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC