Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #2953 > unrolled thread
| Started by | Flag <michael.mustun@gmail.com> |
|---|---|
| First post | 2013-02-04 22:43 +0100 |
| Last post | 2013-02-09 10:40 +0000 |
| Articles | 9 — 7 participants |
Back to article view | Back to comp.programming
New Programming Language - any ideas? Flag <michael.mustun@gmail.com> - 2013-02-04 22:43 +0100
Re: New Programming Language - any ideas? jt@toerring.de (Jens Thoms Toerring) - 2013-02-08 00:05 +0000
Re: New Programming Language - any ideas? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-02-08 01:10 +0000
Re: New Programming Language - any ideas? mertesthomas@gmail.com - 2013-02-08 04:23 -0800
Re: New Programming Language - any ideas? Flag <michael.mustun@gmail.com> - 2013-02-08 22:02 +0100
Re: New Programming Language - any ideas? "BartC" <bc@freeuk.com> - 2013-02-08 18:03 +0000
Re: New Programming Language - any ideas? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-02-08 10:20 -0800
Re: New Programming Language - any ideas? Flag <michael.mustun@gmail.com> - 2013-02-08 21:59 +0100
Re: New Programming Language - any ideas? Rui Maciel <rui.maciel@gmail.com> - 2013-02-09 10:40 +0000
| From | Flag <michael.mustun@gmail.com> |
|---|---|
| Date | 2013-02-04 22:43 +0100 |
| Subject | New Programming Language - any ideas? |
| Message-ID | <kepa2j$hhi$1@speranza.aioe.org> |
Hi
Remember the days writing just BEEP to get a beep? Or SOUND 440 to get
an A? Or just enter PLOT 10,10 to get a dot at 10,10 ?
There are many programming languages... Give me my simple BASIC back!
Basically they are all more or less the same. See an example here:
http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(string_functions)
Example: String manipulations
-----------------------------
Why is it so hard to just compare a string with another in some languages?
Why do we need to write the same again and again for the same task in a
different language so different? (Actually the devil is in the details.)
Very high Languages
-------------------
I also think about very high-languages like LiveCode (RunRev)
http://www.runrev.com/products/livecode/text-and-data-processing/
where you write:
put word 3 to 6 of "The quick brown fox jumped over the lazy dog." into
theVariable
Compared with Java:
String [] theWords = "The quick brown fox jumped over the lazy
dog".split(" ");
String theVariable = "";
for(int i = 2; i <= 5; i++) {
theVariable += theWords[i] + " ";
}
So the only thing here I can see with the so called high-languages is
that it is no assembly or machine code.
A new language
--------------
So let's start a new one: (It's a quick and dirty hack right now.)
Hello World:
http://bazaar.launchpad.net/~michael-mustun/cl/trunk/view/head:/hello.cl
The basic idea is to get the best of some languages and put it into one.
Some text string manipulations from SPITBOL, Snobol4.
Some from Pascal: end.
Some from R: plot(x,y)
Some ideas from very high languages like LiveCode but I think coding is
not English or any other real spoken languages. (You will never tweet or
sing your source code ... but who knows... ;)
More ideas
----------
Why we write for an loop in some languages FOR, in some WHILE, LOOP or
whatever?
If we had higher abstraction of such "high language" basics like IF,
LOOP, etc. who cares about a strange syntax?
Is it just all sh** as Zed A. Shaw said in http://vimeo.com/43380467 -
"The Web Will Die When OOP Dies" ?
Bye,
Michael
[toc] | [next] | [standalone]
| From | jt@toerring.de (Jens Thoms Toerring) |
|---|---|
| Date | 2013-02-08 00:05 +0000 |
| Message-ID | <anitqnFj81kU1@mid.uni-berlin.de> |
| In reply to | #2953 |
Flag <michael.mustun@gmail.com> wrote:
> Remember the days writing just BEEP to get a beep? Or SOUND 440 to get
> an A? Or just enter PLOT 10,10 to get a dot at 10,10 ?
I also remember well that by a typo you could easily format your
hard disk...
> There are many programming languages... Give me my simple BASIC back!
> Basically they are all more or less the same. See an example here:
> http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(string_functions)
> Example: String manipulations
> -----------------------------
> Why is it so hard to just compare a string with another in some languages?
> Why do we need to write the same again and again for the same task in a
> different language so different? (Actually the devil is in the details.)
> Very high Languages
> -------------------
> I also think about very high-languages like LiveCode (RunRev)
> http://www.runrev.com/products/livecode/text-and-data-processing/
> where you write:
> put word 3 to 6 of "The quick brown fox jumped over the lazy dog." into
> theVariable
> Compared with Java:
> String [] theWords = "The quick brown fox jumped over the lazy
> dog".split(" ");
> String theVariable = "";
> for(int i = 2; i <= 5; i++) {
> theVariable += theWords[i] + " ";
> }
I don't know Java and, while being not a Pythonista, I have
to use it quite a lot at the moment, so there you can do it
with
theWords = "The quick brown fox jumped over the lazy dog."
theVariable = ' '.join(theWords.split(' ')[2:6])
or, one line shorter if the 'theWords' variable isn't needed:
theVariable = ' '.join("The quick brown fox jumped over the lazy dog.".split()[2:6])
If prodded enough I probably alsoc ould do it in Perl in a
one- or two-liner.
> So the only thing here I can see with the so called high-languages is
> that it is no assembly or machine code.
How well do you know the "so called high-languages"? And what
do you consider to be high-level?
> A new language
> So let's start a new one: (It's a quick and dirty hack right now.)
If I would have gotten a dollar for every time someone flouted
"the new programming language" that can replace all the others
in the last 25 years I would be a lot nearer to being a millio-
naire;-) And, for some reasons, "natural language" programming
languages always promised everything and the neighbors dog. but
never delivered. I leave answering the "why" as an exercise to
the readers;-)
> Hello World:
> http://bazaar.launchpad.net/~michael-mustun/cl/trunk/view/head:/hello.cl
> The basic idea is to get the best of some languages and put it into one.
And the result: stuff that looks as horrible unstructured as the
BASIC/bash mix this is probably concocted from...
> Some text string manipulations from SPITBOL, Snobol4.
> Some from Pascal: end.
> Some from R: plot(x,y)
What does this is supposed to mean?
> Some ideas from very high languages like LiveCode but I think coding is
> not English or any other real spoken languages. (You will never tweet or
> sing your source code ... but who knows... ;)
Some languages shine in certain problem domains but utterly fail
in all others. Some aren't too good in any special domain but, in
the grand total, are still better. That's why a lot of stuff
nowadays is written in different parts, using different lan-
guages for the sub-part where it is really useful, and the
whole thing wrapped together using one of the "bad" but less
specialized languages.
> More ideas
> ----------
> Why we write for an loop in some languages FOR, in some WHILE, LOOP or
> whatever?
'while', 'do' and 'for' typically are for slightly different
situations ('do' when you need to loop at least once, 'while',
when you may have to skip the loop completely, and 'for' when the
loop needs some initialization and post-loop work)... And then
you have to consider that some people say 'Ja', 'others 'si',
and others 'oui', when they all want to express the same as
'yes' might have done (if they just would speak English as
you're used to it;-)
> If we had higher abstraction of such "high language" basics like IF,
> LOOP, etc. who cares about a strange syntax?
"Strange syntax" is always the syntax you haven't gotten used
to. And define what you consider to be "higher abstraction".
Also take a look at functional languages - some of their ele-
ments are making it into more procedural languages since some
years and that is, IMHO, a good thing. But not necessarily
making the syntax easier to understand at the first glance;-)
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2013-02-08 01:10 +0000 |
| Message-ID | <0.2b9532b2202440aabf9b.20130208011040GMT.87obfv390v.fsf@bsb.me.uk> |
| In reply to | #2964 |
jt@toerring.de (Jens Thoms Toerring) writes:
<snip>
>> put word 3 to 6 of "The quick brown fox jumped over the lazy dog." into
>> theVariable
>
>> Compared with Java:
>
>> String [] theWords = "The quick brown fox jumped over the lazy
>> dog".split(" ");
>> String theVariable = "";
>> for(int i = 2; i <= 5; i++) {
>> theVariable += theWords[i] + " ";
>> }
>
> I don't know Java and, while being not a Pythonista, I have
> to use it quite a lot at the moment, so there you can do it
> with
>
> theWords = "The quick brown fox jumped over the lazy dog."
> theVariable = ' '.join(theWords.split(' ')[2:6])
>
> or, one line shorter if the 'theWords' variable isn't needed:
>
> theVariable = ' '.join("The quick brown fox jumped over the lazy dog.".split()[2:6])
>
> If prodded enough I probably alsoc ould do it in Perl in a
> one- or two-liner.
Perl is similar in that you could write:
join ' ', (split ' ', $theWords)[2..5]
Though knowing Perl (or rather not knowing it as well as many) I'll bet
there are cunning sorter solutions.
<snip>
--
Ben.
[toc] | [prev] | [next] | [standalone]
| From | mertesthomas@gmail.com |
|---|---|
| Date | 2013-02-08 04:23 -0800 |
| Message-ID | <9d2df089-027c-4e63-be33-c8fc400f476f@googlegroups.com> |
| In reply to | #2953 |
On Mon, 4. Feb 2013 22:43:51 UTC+1, Flag wrote:
> Remember the days writing just BEEP to get a beep? Or SOUND 440 to get
> an A?
Only a tiny minority is interested in this form of sound support.
Most people are more interested in other things. E.g.: Data formats
like XML and HTML, compression of data, protocols like FTP and HTTP,
Unicode support, etc. Sound is not a big issue, especially in
commercial applications. It was actually my plan to support sound
in Seed7. But supporting it under Windows and Linux (Unix, BSD)
together with X11 (when the display is remote the sound should be
also remote) requires driver libraries. And there was no demand for
sound statements...
> Or just enter PLOT 10,10 to get a dot at 10,10 ?
Actually Seed7 supports functions like point and line.
> There are many programming languages... Give me my simple BASIC back!
Simple BASIC had line numbers and only minimal support for
structured programming. If you are interested, I wrote an
interpreter for a GW-BASIC like language:
http://seed7.sourceforge.net/scrshots/bas7.htm
> Why is it so hard to just compare a string with another in some languages?
But in some languages you can just use = or <> to compare strings.
[snip]
> put word 3 to 6 of "The quick brown fox jumped over the lazy dog." into theVariable
Words are not always separated by spaces. What about punctuation
marks or operator symbols. When all this things are taken into
account the solution is not so simple and elegant as a one-liner.
As others pointed out, several languages can provide a simple
solution for the case of space separated words. In Seed7 you would
use the expression:
join(split("The quick brown fox jumped over the lazy dog.", " ")[3 .. 6], " ")
More advanced aproaches to split a string into pieces use patterns
or scanner functions. Scanner functions are used in compilers to
read the symbols of a program. Seed7 has also scanner functions
for different purposes:
http://seed7.sourceforge.net/libraries/scanstri.htm
http://seed7.sourceforge.net/libraries/scanfile.htm
[snip]
> So the only thing here I can see with the so called high-languages is
> that it is no assembly or machine code.
Usually a program in a high-language should be source code portable.
Which IMHO means that no source code changes are necessary. Note
that many languages, that claim to be portable, do actually NOT
reach this level of portability. E.g.: Consider differend path
representations between Windows and Linux.
> So let's start a new one: (It's a quick and dirty hack right now.)
> Hello World:
> http://bazaar.launchpad.net/~michael-mustun/cl/trunk/view/head:/hello.cl
This really looks like a dirty hack.
> The basic idea is to get the best of some languages and put it into one.
That's basically the idea I had 1980/1981: An extensible programming
language. I wrote my diploma thesis and my doctorate thesis about
it. I started with an implementation in 1989 and released it under
the name Seed7 in 2005.
> Some text string manipulations from SPITBOL, Snobol4.
> Some from Pascal: end.
> Some from R: plot(x,y)
> Some ideas from very high languages like LiveCode but I think coding is
> not English or any other real spoken languages. (You will never tweet or
> sing your source code ... but who knows... ;)
You can get inspirations from different sources, but there must be
a common syntax and semantic. Otherwise parsing gets very
complicated and readability decreases.
> Why we write for an loop in some languages FOR, in some WHILE, LOOP or
> whatever?
As others pointed out this loops have different purposes.
> If we had higher abstraction of such "high language" basics like IF,
> LOOP, etc. who cares about a strange syntax?
Maybe the people who read the programs, care about the syntax.
For the higher abstraction I have a solution:
You define syntax and semantic of the statements in your language.
Regards,
Thomas Mertes
--
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.
[toc] | [prev] | [next] | [standalone]
| From | Flag <michael.mustun@gmail.com> |
|---|---|
| Date | 2013-02-08 22:02 +0100 |
| Message-ID | <kf3p57$keg$1@speranza.aioe.org> |
| In reply to | #2969 |
Interesting thing. Seed7. I did a quick and dirty hack... but it was interesting to see that on many point I come up something like PASCAL also. We need this, do that... ok, the simplest way to do that within a UNIX Shell and C/C++ environment is to do it like this... maybe it also what the author of Pascal used to develop his language... I don't know.
[toc] | [prev] | [next] | [standalone]
| From | "BartC" <bc@freeuk.com> |
|---|---|
| Date | 2013-02-08 18:03 +0000 |
| Message-ID | <J6bRs.4956$cG5.3964@fx31.fr7> |
| In reply to | #2953 |
"Flag" <michael.mustun@gmail.com> wrote in message
news:kepa2j$hhi$1@speranza.aioe.org...
> Remember the days writing just BEEP to get a beep? Or SOUND 440 to get an
> A? Or just enter PLOT 10,10 to get a dot at 10,10 ?
>
> There are many programming languages... Give me my simple BASIC back!
There are hundreds of Basics. You can probably find one that can still do
PLOT 10,10, but it might only place the dot inside a window.
> Why is it so hard to just compare a string with another in some languages?
The languages where it's difficult, are quite likely the ones used to
implement the rest!
> put word 3 to 6 of "The quick brown fox jumped over the lazy dog." into
> theVariable
>
> Compared with Java:
>
> String [] theWords = "The quick brown fox jumped over the lazy
> dog".split(" ");
> String theVariable = "";
> for(int i = 2; i <= 5; i++) {
> theVariable += theWords[i] + " ";
> }
At least Java seems to cope with variable length strings and lists. But it
doesn't appear to have a 'join' function built-in. That means you'd have to
create it. Then the last part of that becomes:
String theVariable = join(theWords," ");
not that different from other short examples that have been given. (And you
won't have a trailing space either...)
> A new language
> --------------
>
> So let's start a new one: (It's a quick and dirty hack right now.)
>
> Hello World:
>
> http://bazaar.launchpad.net/~michael-mustun/cl/trunk/view/head:/hello.cl
>
> The basic idea is to get the best of some languages and put it into one.
That's looks more like the Frankenstein approach to creating a language!
And you haven't taken the best bits either: The need for 'break' in C's
'switch' statement is poor design, and its 'for' statement must be one of
the most convoluted ways of writing a simple iterative loop ever devised
(even using 'goto' would be less work to write).
--
Bartc
[toc] | [prev] | [next] | [standalone]
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Date | 2013-02-08 10:20 -0800 |
| Message-ID | <2mbRs.24098$H22.8993@newsfe13.iad> |
| In reply to | #2953 |
On 2/4/13 1:43 PM, Flag wrote:
> Hi
>
>
> Remember the days writing just BEEP to get a beep? Or SOUND 440 to get
> an A? Or just enter PLOT 10,10 to get a dot at 10,10 ?
>
> There are many programming languages... Give me my simple BASIC back!
>
> Basically they are all more or less the same. See an example here:
> http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(string_functions)
>
>
>
> Example: String manipulations
> -----------------------------
>
> Why is it so hard to just compare a string with another in some languages?
> Why do we need to write the same again and again for the same task in a
> different language so different? (Actually the devil is in the details.)
>
>
> Very high Languages
> -------------------
>
> I also think about very high-languages like LiveCode (RunRev)
> http://www.runrev.com/products/livecode/text-and-data-processing/
>
> where you write:
>
> put word 3 to 6 of "The quick brown fox jumped over the lazy dog." into
> theVariable
>
> Compared with Java:
>
> String [] theWords = "The quick brown fox jumped over the lazy
> dog".split(" ");
> String theVariable = "";
> for(int i = 2; i <= 5; i++) {
> theVariable += theWords[i] + " ";
> }
>
> So the only thing here I can see with the so called high-languages is
> that it is no assembly or machine code.
>
>
> A new language
> --------------
>
> So let's start a new one: (It's a quick and dirty hack right now.)
>
> Hello World:
>
> http://bazaar.launchpad.net/~michael-mustun/cl/trunk/view/head:/hello.cl
>
> The basic idea is to get the best of some languages and put it into one.
>
> Some text string manipulations from SPITBOL, Snobol4.
> Some from Pascal: end.
> Some from R: plot(x,y)
> Some ideas from very high languages like LiveCode but I think coding is
> not English or any other real spoken languages. (You will never tweet or
> sing your source code ... but who knows... ;)
>
>
> More ideas
> ----------
> Why we write for an loop in some languages FOR, in some WHILE, LOOP or
> whatever?
>
> If we had higher abstraction of such "high language" basics like IF,
> LOOP, etc. who cares about a strange syntax?
>
> Is it just all sh** as Zed A. Shaw said in http://vimeo.com/43380467 -
> "The Web Will Die When OOP Dies" ?
>
>
> Bye,
> Michael
The first thing you need to think about are the use-cases your language
is designed to solve. It sounds like you're focusing on string
manipulation and pixel drawing. Those aren't very useful in a general
sense, but may be useful if that's all you are doing.
For a programming language to be successful, it needs to solve for
real-world problems. Not many people want something along the natural
language approach, since that actually is *more* difficult for common
operations.
Also, if you want a "general" programming language, it needs to be
Turing complete. Meaning it can be used to solve all the same problems
any other Turing complete language can.
Another important thing for a programming language is the efficiency of
the final result.
You also don't want to have a Hodge-podge of incompatible or redundant
idioms. There should be a clear way to implement something with the
primitives of your language.
[toc] | [prev] | [next] | [standalone]
| From | Flag <michael.mustun@gmail.com> |
|---|---|
| Date | 2013-02-08 21:59 +0100 |
| Message-ID | <kf3ova$j14$2@speranza.aioe.org> |
| In reply to | #2972 |
I think it is turing complete because it's C with just some "short-cuts". It generates pure C/C++ code which will be compiled. (Just on a experimental basis... I know... with a SED (as a pre-Preprocessor) and a regular Pre-Processor.)
[toc] | [prev] | [next] | [standalone]
| From | Rui Maciel <rui.maciel@gmail.com> |
|---|---|
| Date | 2013-02-09 10:40 +0000 |
| Message-ID | <kf5925$hq9$1@dont-email.me> |
| In reply to | #2953 |
Flag wrote: > Hi > > > Remember the days writing just BEEP to get a beep? Or SOUND 440 to get > an A? Or just enter PLOT 10,10 to get a dot at 10,10 ? > > There are many programming languages... Give me my simple BASIC back! > > Basically they are all more or less the same. See an example here: > http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(string_functions) > > > Example: String manipulations </snip> It's your own time, and therefore you have the right to waste it as you see fit. I hope you find it to be a valuable learning experience, because from your description and your design goals, it has absolutely no other purpose or usefulness than that one, as it sounds like a pointless exercise in implementing a whole new platform based on a string of bad design decisions. Have fun, Rui Maciel
[toc] | [prev] | [standalone]
Back to top | Article view | comp.programming
csiph-web