Just a quick note about preformance of applications crossing programming languages.
In quite a few cases, it's difficult to determine if one programming language is faster or slower then another due to the operating system's integration with that language, and how the programs are actually written. Having been programming many more years then I care to share, I've been forced to do real time examples within my shop to demonstrate what I mean.
I have written several testing applications in C++, Delphi, VB.NET and VC.NET that I took the time to maximize performance as the programming language would permit. Time after time, the performance differences are nominal. Granted all of my testing is based on the same machine / operating system, demonstrating the effects of understanding a languages strength and weakness and coding to take advantage and avoiding as needed it's been demonstrated time and time again; a solid and strong understanding of the targeted environment and the programming language used will provide similar results.
This being said, you can immediately come to understand that the targeted operating system imposes the most overhead within an application. If you should include poor programming practices, that affects the overall performance of your application. In the days of DOS, even a poorly written C application out preformed a compiled well written BASIC application because of the overhead it took to make a BASIC application executable. In today's world of multitasking, multicore soft/hard ware PC's, with all of the OS overhead, any competent programmers of most any language can achieve comparable results.
The key to all of this is "how much work / programming required" to achieve the desired performance. Some things C++/VC.NET are simply the hands down easy way to do it, and in other cases, VB.NET or Delphi are the only logical choices. It all depends on what you are defining as performance of the application and the target environment.
I've told, teach and preach to each and every intern I've mentored; every student I've taught the simple rule:
"Pick a language based not on preference, but on need. Learn a language based on need and not preference. Master a language by understanding it's strengths and weakness, and then, look not at the language and say It can't be done, rather look for a language that it can be done. Picking a single language to Master is akin to picking a single uC and never considering a different one. Instead, pick several languages. Work in them all. While learning the language, write in one what you wrote in the others. See how or what you can do to it to increase it's performance."
The above paragraph is taken directly from my introduction to programming concepts, and leads into the discussions of language selection and it's dependence on hardware and the task at hand.
Sorry the post is so long, but I figured that if this subject has taken as many pages as this has, someone should introduce the fact that a language is only as strong as the hardware permits it to be, for the task at hand.
Spiral_72
'
Take a look at Just BASIC v1.01.
'
Its really easy to learn,It will open up COM 3 on your USB port, And GUIs are really easy to make.
'
Lots of examples
'
Its also FREE.and you can upgrade to Liberty BASIC v4.03 for under $50.00
'
They have a pretty good forum too.
'
Just adding to the list. Hope this helps.
'robotbasic free and with all kind of support, Unland
Interesting - but rather quirky.....
It does not like Names_Like_this ?!
- and it lacks conditional compile control.
Lacks Const,
DIM Div As Double fails,
it chokes on this
Crystal = Array(3.579545e6, 4.43361875e6)
with poor syntax messages and locations.
.. but it does manage simple GUI's nicely, and has a usable Debug feature.
- so you could use JustBasic to craft a quick GUI for a more serious FreeBasic engine ?
You have inspired a great debate here. Normally a question about language selection (or editors, or operating systems...) would result in a huge mud slinging match on the internet. Thankfully Parallaxians are more
civilized about such things.
There have been a lot of good suggestions here, as other have pointed out it's good to learn more than one programming language. Although that than can take a lot of time and lead down dead ends. For example I spent a while learning and working with PHP, and now whish I had not had to, life is to short.
The main point of programming languages is communication between man and machine but let's not forget that they are used an awful lot for communication between people, like when you want to share your work, show off what you have done, ask others for advice or work collaboratively.
With that in mind here are my criteria for lanuage choice:
1) Must be OS independent. In the modern world that means at least usable on at least Windows, Mac, Linux, BSD. If we can cover mobile devices lets include Android and such as a bonus. A langauge system get's extra points if it is usable without an OS on small computers/micro-controllers.
2) Must be hardware independent. Again in the modern world that means at least x86 and ARM. Bonus points again for being usable on other architectures.
3) Must be free. Free as in free of restictive licensing and free as in zero cost. This is a language we are talking about I should not be beholden to some company and their licensing to use a language and I should not have to pay to speak it. I have done a lot of work in the past with languages and tools that were expensive and proprietary only to see them become dead ends.
4) Must be compliant to some recognized standards such that anyone can implement it given the time and skill.
5) Must have a thriving user community of individuals and comapanies. This maximizes the audience for whatever you do and maximizes the available help and cooperation available.
6) (Perhaps this should be 0)) Must be available for the platform I actually want/need to use. At the end of the day we need to get the job done.
Note: I nearly skipped over the Prop years ago because Spin and the Spin toool don't meet any of those requirements except 6)/0). Fortunately things like BST and HomeSpun turned up, then Catalina and now propgcc and an open source Spin tool.
Having said all that what does it leave us? On the PC end we have:
Perl - Universal, easy, slow, gives you braindamage.
Python - Universal, easy, slow, can't stand the white space block delimiting
C - Universal, bit harder and more work. Fast. Not cool for GUI's
C++ - Universal, much harder, good for GUI's if you use a crossplatform tool
kit like Qt. Fast.
Pascal - Universal, can aslo be used for GUIs, Fast.
C# - Windows and Linux (using mono). Good for GUI's if you stay away from
Windows specific features. Bit slow.
Java - Sort of universal. Slow. Licensing is an issue (See Oracle vs Google)
I'm going to throw a new name into the mix. It's actually an old language. Everyone uses it every day. It can be very easy to work with. It runs on your PC your ARM board, your phone. It's good for data display and GUI's, even 3D graphics, in a very cross platform way. It standard, open and free. It can compete on speed with native code. Everyone has the dev kit installed on thier PC. There is an ocean of support for it.
What is this magical langage? Javascript.
Yes JS is now usable to create programs that run stand alone outside the browser. Such programs can easily accomodate serial comms, network comms, http, ftp, whatever.
I've been using JS JustBasic to do Windows based Propeller controls and it works like a champ.
There are limitations, but on the upside it's painless to follow the code if you are used to BASIC or Spin.
I've been using JS to do Windows based Propeller controls and it works like a
champ.
You do mean JavaScript right? Please elaborate what did you do and what does it
mean "Windows based". JS is primarily used in browsers so far. Any browser
anywhere. Now we have the means to run JS outside the browser as a stand alone
program there is nothing Windows specific about it.
There are limitations, but on the upside it's painless to follow the code if you
are used to BASIC or Spin.
All language systems have limitations and JS can be easy to follow, or not. JS
has a lot more language features than BASIC or Spin. Features that do not appear
in such languages not even C, C++, ADA, Pascal etc. I'm thinking things like:
1) Nested functions, you can define a function within a function. I never
really understood why anyone would want to do that but it becomes useful with
the following.
2) Closures. If there exists any reference to a nested function then all the
local variables (and functions) of the enclosing function remain in existence
even after the enclosing function has returned. Locals don't go out of scope
like they do in C and more usual block structured languages
3) Events. The above means that an event can trigger a nested function long
after the enclosing function has returned and everything still works.
4) All the above can be put together to do object oriented programming if you
like.
JS has been out of reach for ages at "it's just a browser scripting language".
Looks like you need a server for those web pages it sits in. It can't interact
with your local machine, files, serial ports etc.
Thing is you don't need a web server to run you JS. Just point your browser at
an HTML file on your machine.
Now that we can run JS as a stand alone program it has full access to your
machine and your browser code can easily communicate with that program. I think
there is a lot of scope here.
The OP was asking for what laguage to use for his specific purpose. This thread went far away from that so I guess I can throw in my to cents.
Since computer are there to help you to solve problems you would not have without computers we might need to ask for the goal to archive.
I went to this thread carefully and found some mixup between languages,operating systems,and goals. Lets try to sort:
First the languages - there are plenty of them and as heater(?or jazzed?) said all of them are like C exept FORTH. mostly he is right.
This is true and false at the same time because there is not much movement anymore there - they all cook with water.
I started programming in assembler - mostly even hexcodes - because of the shortage of languages at all. There was no "C".
We had assembler or COBOL,FORTRAN and ALGOL. if even that.There was no operating system at all.
I was sitting in a BAR latly and was told by some young guy I was playing pool with that "You do not undestand this - we grow up with computers, we had them all of our life, and we know more about them as you, old man." Well - yes - using them. We invented and build them.
Languages are tools. you can/will/must use more then one. Every one has her own beauties.
YES for shure PHIL loves PERL. It fits his goals. Some people like PASCAL/MODULA some prefere C or (like me) SPIN and PASM.
Not because the language is superior to the other but because it fits the needs/goals.
Operating Systems. - also plenty of them.
This is where a computer language in all her beauty get to the first stress-test - does it work ? And honestly SHOULD it anyways ?
The first I met was called VMS followed by MVS and shoot tons of others. We do not need a Operating System War here but as far as I know GNU and all of his friends are running on all major OSess and (unfortunatly for those MS disaprovers) thanks to MONO C# and MS netframework also.
So from ARM to PC to SPARC to IBM/370 to As/400 MONO is running. So does the net-framework. and the funny thing is - since it is a bytecode (like java) it is copy to deploy.
Compile a web-application on a windows pc, or on a arm mini-linux. same bytecode. Copy files to solaris 10 on sparc and it works.
NOT copying source and recompile - JUST copy generated files of your windows/linux/whatever developer computer.
Even a network share does it.
The same you can archive with plenty other languages on all major OSsses- SO WE ARE DOWN TO THE GOALS.
.
You can use ANY language on ANY hardware (well- allmost) at just comes down to what fits best, isn't it ?
So depending on the GOAL decide the LANGUAGE. Even COBOL may fit.
Maybe even FORTH (gosh its gettiing dark here suddendly)
help me ... the doldrums .. reverse polish notation ... hey .. stop .. I just said FORTH ... never used it ... go ...go away ...
So my advise for the OP is MONO and MONOdevelop to be platform independent in development. If development is on windows use Visual Studio. Run Monodevelop to test for other client-platforms.
And use C# not VB.net. It pays off in the long run.
for the record, I've had a lot of luck with QB64 for prototyping. The learning curve was steep and the speed was reasonably fast. I also liked JustBASIC, but fell in love with QB64.
I tried and tried to use Python, but it just wasn't working for me at all...... and I WANTED to learn it.
LCC-Win32 has treated be well so far. This is what I'm trying to use for the real PC programming. I'm not sure if it's the wisest decision but it's working so far.
Oh, and I started learning SPIN for the Prop in all this. I was shocked how easy it was ...... not a computer programming language, but just for the record.... even though I think it's been a month since I've had microcontrollers out on my workbench.
The original post requested a new programming language, moving from DOS. So comfort zone is with command line.
Suggestion: Check out CSP channels. My rig happens to have the PC side implemented in GO, and the Prop side implemented in propforth. But the PC side could just as easily be implemented in Python or C, and the prop side could just as easily be implemented in PASM, C or anything that runs on the prop. In fact, one of the really smart guys is strangely silent today, I expect there will be a non-forth implementation by Wednesday(?).
So result is the prop just runs a "firmware" or "bios" (wait, wait, hang on) that just gives ACCESS to the prop I/O resources, like the pins, or drivers that talk to the device hanging off the pins. The chunky, meaty part of the application can live on the pc, where you write your code in what ever environment suits you at the time.
OBC,
Ah yes, JB not JS.
Never heard if it but then I have never heard of many things.
Braino,
By the time you have chopped and changed languages at the PC end and then chopped and changed languages at the Prop/target end all you have left is a means of multiplexing many logical comms channels through a single physical link.
That is nothing to do with CSP as formalized by Tony Hoare and others. Please do not call it such.
I'm going to throw a new name into the mix. It's actually an old language. Everyone uses it every day. It can be very easy to work with. It runs on your PC your ARM board, your phone. It's good for data display and GUI's, even 3D graphics, in a very cross platform way. It standard, open and free. It can compete on speed with native code. Everyone has the dev kit installed on thier PC. There is an ocean of support for it.
What is this magical langage? Javascript.
What an audacious suggestion!
Ok, here is some javascript http://www.w3schools.com/js/js_popup.asp and like you say, you can "run" that program on any computer. Follow that link, try it, and click the button. It works!
<html>
<head>
<script type="text/javascript">
function show_alert()
{
alert("Hello! I am an alert box!");
}
</script>
</head>
<body>
<input type="button" onclick="show_alert()" value="Show alert box" />
</body>
</html>
Just in the last few days I have got some things working with the touchscreen that could do the button and the text. So the
input type="button"
runs a routine in Spin that takes a button image from the sd card and puts it on the screen (or displays it from ram if you want a faster display).
value="Show alert box"
runs another routine that loads in the appropriate font and displays the text (centered) in the middle of the button.
Then you need to tell the touchscreen where the box is on the screen, so you can detect it being touched.
And finally display the alert box as a popup.
The cool thing is that all those routines are already written and working.
So what we need next is a parser to translate that javascript code and call the appropriate spin routines.
I took a look at some parsers and there are some written in C. So that should be possible with GCC or Catalina.
I'd be interested in seeing what that parser code actually looks like, ie the bit of code that chops up a line like
Javascript would be a cool language to build a GUI for the propeller as it would greatly aid debugging to also be able to run your program on any computer you like. Plus there is a version of pacman written in javascript that I want to get going. Lots of tile manipulation, which the propeller does really well.
addit: I'm looking at this new language with an unbiased newbie view - I've never coded in javascript. Those examples in the tutorial do not seem unfamiliar though.
I agree with Phil that you should avoid OS-specific languages. Personally I have had a lot of fun working with Ruby. I love the language's design. I can't imagine taking up Perl except on a dare.
While it takes a while to get the hang of the "perl way of programming" it's not a hard language to learn! I have to admit I tend to write my perl scripts so that they look a lot like perl. The big difference is that I use a lot of hashes!
I wouldn't mind using the visiual-x languages but I can't find any compilers for them that run under Linux or Solaris!!
Don't even think about it. It's a huge task and clearly impossible on the Propeller.
Most of what you were discussing in the post above was not JavaScript at all but HTML. So first you are going to need to build an HTML parser and renderer. That is the thing that is building your display of text, buttons etc etc.
I guess one could consider a severely limited parser/renderer that works on some HTML subset though.
The actual JavaScript there is the "function show_alert() { ... } that is embedded between HTML script tags. And the call to that function embedded in an HTML input elements attribute.
So now we are going to need another parser/compiler/interpreter for the JavaScript language itself. If you want one you can download the source code to Google's V8 JavaScript engine as used in their Chrome browser and the node.js system. The version I have here is almost two hundred thousand lines of C++!!!
Oh bother. Still, I'm sure we can get something going. I'm making progress with an html interpreter written in spin, and doing things like having a button run some code is the next step. Need a super simple language, eg the way there is a simple version of Basic on the basic stamp, and a simple version of C on the arduino. A simple version of javascript, like the examples in that tutorial. Is there such a thing as "C script"?
Since I had never heard of "Processing.org", (way back on post #7), I thought I'd give it a try. It's pretty much Java. After about 2 hours I had a grid, after another two hours I had a running program that shows that status of P0 thru P7 on the QS board. I'm impressed! If you haven't tried this and you have some java background, you should give this a look.
Note 1: the draw() function defaults to looping.
Note 2: there exists a Processing.js for javascript programmers. I'm not sure if it exposes the serial ports or not.
Here's the .pde file:
/*
* _8_outputs
* shows status of propeller P0 thru P7
* 4/25/2012
*/
import processing.serial.*;
Serial myPort; // Create object from Serial class
int val, x, old_x; // Data received from the serial port
int[] p = new int[8]; // 4 index array
int[] oldY = new int[8]; // old y value
void setup()
{
size(500, 400);
// COM1 = [0], COM2 = [1], COM12 = [2], COM14 = [3] (.. I think, on my system, YMMV)
String portName = Serial.list()[2]; //QUICKSTART COM12 = [2]
myPort = new Serial(this, portName, 115200);
GRID();
}
void draw() {
old_x = x;
x = x + 2;
stroke(255);
strokeWeight(2);
get_serial(); //get val from propeller here
int n = 1;
for (int i = 0; i < 8; i++) {
p[i] = 0;
int v = val & n;
if (v > 0) {
p[i] = -20;
}
//print(n);
n = n << 1;
int y = p[i]+(i*50)+25;
line( x, y, old_x, oldY[i]);
oldY[i] = y;
}
if (x > width) {
x = 0;
GRID();
}
}
void get_serial() {
if ( myPort.available() > 0) { // If data is available,
val = myPort.read(); // read it and store it in val
print(val);
print(",");
//val = val - 48;
}
}
void GRID() {
background(0); // Set background to black
stroke(#007777);
strokeWeight(1);
for (int j = 50; j < 500; j=j+50){
for (int i = 4; i < 500; i=i+12){
line (i,j, i+7,j);
line (j,i, j,i+7);
}
}
}
This is very interesting and a great way to hook the Prop to the PC. Could you post the .SPIN code that is running on the QuickStart so we can see how the two hook together? I assume the "monitor" on the Prop is gathering and collecting data from the prop side and sending it across the serial link, it would be helpful to see your monitor code also.
As requested: Here is probably the lamest code to be posted on this forum:
{{
Processing.serial.*.
}}
CON
_CLKMODE = XTAL1 + PLL16X
_CLKFREQ = 80_000_000
var byte i
OBJ
pst : "PST"
PUB Main
pst.start(115200) 'com 12 : QS
dira[23..16]~~ ' Set the LEDs as outputs
repeat
i++
outa[23..16] := i
pst.tx(ina[23..16])
waitcnt(clkfreq / 12 + cnt)
Simply adds a count every 1/12 of a second and sends it to PST and then it just rolls over to 0 when it hits the maximum count. I'm not sure what you mean by prop "monitor". I'm substituting the running Processing program for the PST window.
In one earlier attempt I was monitoring the switches on the QS board using the same 8 P0 thru P7 outputs and the "Button Touch 2" from OBEX.
@ Eric. C# might be easier but I've never tried it. I've used JAVA some 25 years. It's whatever works for you.
Comments
FreeBASIC
Free Pascal
In quite a few cases, it's difficult to determine if one programming language is faster or slower then another due to the operating system's integration with that language, and how the programs are actually written. Having been programming many more years then I care to share, I've been forced to do real time examples within my shop to demonstrate what I mean.
I have written several testing applications in C++, Delphi, VB.NET and VC.NET that I took the time to maximize performance as the programming language would permit. Time after time, the performance differences are nominal. Granted all of my testing is based on the same machine / operating system, demonstrating the effects of understanding a languages strength and weakness and coding to take advantage and avoiding as needed it's been demonstrated time and time again; a solid and strong understanding of the targeted environment and the programming language used will provide similar results.
This being said, you can immediately come to understand that the targeted operating system imposes the most overhead within an application. If you should include poor programming practices, that affects the overall performance of your application. In the days of DOS, even a poorly written C application out preformed a compiled well written BASIC application because of the overhead it took to make a BASIC application executable. In today's world of multitasking, multicore soft/hard ware PC's, with all of the OS overhead, any competent programmers of most any language can achieve comparable results.
The key to all of this is "how much work / programming required" to achieve the desired performance. Some things C++/VC.NET are simply the hands down easy way to do it, and in other cases, VB.NET or Delphi are the only logical choices. It all depends on what you are defining as performance of the application and the target environment.
I've told, teach and preach to each and every intern I've mentored; every student I've taught the simple rule:
"Pick a language based not on preference, but on need. Learn a language based on need and not preference. Master a language by understanding it's strengths and weakness, and then, look not at the language and say It can't be done, rather look for a language that it can be done. Picking a single language to Master is akin to picking a single uC and never considering a different one. Instead, pick several languages. Work in them all. While learning the language, write in one what you wrote in the others. See how or what you can do to it to increase it's performance."
The above paragraph is taken directly from my introduction to programming concepts, and leads into the discussions of language selection and it's dependence on hardware and the task at hand.
Sorry the post is so long, but I figured that if this subject has taken as many pages as this has, someone should introduce the fact that a language is only as strong as the hardware permits it to be, for the task at hand.
KK
Interesting - but rather quirky.....
It does not like Names_Like_this ?!
- and it lacks conditional compile control.
Lacks Const,
DIM Div As Double fails,
it chokes on this
Crystal = Array(3.579545e6, 4.43361875e6)
with poor syntax messages and locations.
.. but it does manage simple GUI's nicely, and has a usable Debug feature.
- so you could use JustBasic to craft a quick GUI for a more serious FreeBasic engine ?
FreeBasic has a good looking debug in development.
http://www.freebasic.net/forum/viewtopic.php?f=8&t=13935&hilit=fbdebugger
You have inspired a great debate here. Normally a question about language selection (or editors, or operating systems...) would result in a huge mud slinging match on the internet. Thankfully Parallaxians are more
civilized about such things.
There have been a lot of good suggestions here, as other have pointed out it's good to learn more than one programming language. Although that than can take a lot of time and lead down dead ends. For example I spent a while learning and working with PHP, and now whish I had not had to, life is to short.
The main point of programming languages is communication between man and machine but let's not forget that they are used an awful lot for communication between people, like when you want to share your work, show off what you have done, ask others for advice or work collaboratively.
With that in mind here are my criteria for lanuage choice:
1) Must be OS independent. In the modern world that means at least usable on at least Windows, Mac, Linux, BSD. If we can cover mobile devices lets include Android and such as a bonus. A langauge system get's extra points if it is usable without an OS on small computers/micro-controllers.
2) Must be hardware independent. Again in the modern world that means at least x86 and ARM. Bonus points again for being usable on other architectures.
3) Must be free. Free as in free of restictive licensing and free as in zero cost. This is a language we are talking about I should not be beholden to some company and their licensing to use a language and I should not have to pay to speak it. I have done a lot of work in the past with languages and tools that were expensive and proprietary only to see them become dead ends.
4) Must be compliant to some recognized standards such that anyone can implement it given the time and skill.
5) Must have a thriving user community of individuals and comapanies. This maximizes the audience for whatever you do and maximizes the available help and cooperation available.
6) (Perhaps this should be 0)) Must be available for the platform I actually want/need to use. At the end of the day we need to get the job done.
Note: I nearly skipped over the Prop years ago because Spin and the Spin toool don't meet any of those requirements except 6)/0). Fortunately things like BST and HomeSpun turned up, then Catalina and now propgcc and an open source Spin tool.
Having said all that what does it leave us? On the PC end we have:
Perl - Universal, easy, slow, gives you braindamage.
Python - Universal, easy, slow, can't stand the white space block delimiting
C - Universal, bit harder and more work. Fast. Not cool for GUI's
C++ - Universal, much harder, good for GUI's if you use a crossplatform tool
kit like Qt. Fast.
Pascal - Universal, can aslo be used for GUIs, Fast.
C# - Windows and Linux (using mono). Good for GUI's if you stay away from
Windows specific features. Bit slow.
Java - Sort of universal. Slow. Licensing is an issue (See Oracle vs Google)
I'm going to throw a new name into the mix. It's actually an old language. Everyone uses it every day. It can be very easy to work with. It runs on your PC your ARM board, your phone. It's good for data display and GUI's, even 3D graphics, in a very cross platform way. It standard, open and free. It can compete on speed with native code. Everyone has the dev kit installed on thier PC. There is an ocean of support for it.
What is this magical langage? Javascript.
Yes JS is now usable to create programs that run stand alone outside the browser. Such programs can easily accomodate serial comms, network comms, http, ftp, whatever.
I hope to post some simple examples of this soon.
There are limitations, but on the upside it's painless to follow the code if you are used to BASIC or Spin.
OBC
You do mean JavaScript right? Please elaborate what did you do and what does it
mean "Windows based". JS is primarily used in browsers so far. Any browser
anywhere. Now we have the means to run JS outside the browser as a stand alone
program there is nothing Windows specific about it.
All language systems have limitations and JS can be easy to follow, or not. JS
has a lot more language features than BASIC or Spin. Features that do not appear
in such languages not even C, C++, ADA, Pascal etc. I'm thinking things like:
1) Nested functions, you can define a function within a function. I never
really understood why anyone would want to do that but it becomes useful with
the following.
2) Closures. If there exists any reference to a nested function then all the
local variables (and functions) of the enclosing function remain in existence
even after the enclosing function has returned. Locals don't go out of scope
like they do in C and more usual block structured languages
3) Events. The above means that an event can trigger a nested function long
after the enclosing function has returned and everything still works.
4) All the above can be put together to do object oriented programming if you
like.
JS has been out of reach for ages at "it's just a browser scripting language".
Looks like you need a server for those web pages it sits in. It can't interact
with your local machine, files, serial ports etc.
Thing is you don't need a web server to run you JS. Just point your browser at
an HTML file on your machine.
Now that we can run JS as a stand alone program it has full access to your
machine and your browser code can easily communicate with that program. I think
there is a lot of scope here.
Since computer are there to help you to solve problems you would not have without computers we might need to ask for the goal to archive.
I went to this thread carefully and found some mixup between languages,operating systems,and goals. Lets try to sort:
First the languages - there are plenty of them and as heater(?or jazzed?) said all of them are like C exept FORTH. mostly he is right.
This is true and false at the same time because there is not much movement anymore there - they all cook with water.
I started programming in assembler - mostly even hexcodes - because of the shortage of languages at all. There was no "C".
We had assembler or COBOL,FORTRAN and ALGOL. if even that.There was no operating system at all.
I was sitting in a BAR latly and was told by some young guy I was playing pool with that "You do not undestand this - we grow up with computers, we had them all of our life, and we know more about them as you, old man." Well - yes - using them. We invented and build them.
Languages are tools. you can/will/must use more then one. Every one has her own beauties.
YES for shure PHIL loves PERL. It fits his goals. Some people like PASCAL/MODULA some prefere C or (like me) SPIN and PASM.
Not because the language is superior to the other but because it fits the needs/goals.
Operating Systems. - also plenty of them.
This is where a computer language in all her beauty get to the first stress-test - does it work ? And honestly SHOULD it anyways ?
The first I met was called VMS followed by MVS and shoot tons of others. We do not need a Operating System War here but as far as I know GNU and all of his friends are running on all major OSess and (unfortunatly for those MS disaprovers) thanks to MONO C# and MS netframework also.
So from ARM to PC to SPARC to IBM/370 to As/400 MONO is running. So does the net-framework. and the funny thing is - since it is a bytecode (like java) it is copy to deploy.
Compile a web-application on a windows pc, or on a arm mini-linux. same bytecode. Copy files to solaris 10 on sparc and it works.
NOT copying source and recompile - JUST copy generated files of your windows/linux/whatever developer computer.
Even a network share does it.
The same you can archive with plenty other languages on all major OSsses- SO WE ARE DOWN TO THE GOALS.
.
You can use ANY language on ANY hardware (well- allmost) at just comes down to what fits best, isn't it ?
So depending on the GOAL decide the LANGUAGE. Even COBOL may fit.
Maybe even FORTH (gosh its gettiing dark here suddendly)
help me ... the doldrums .. reverse polish notation ... hey .. stop .. I just said FORTH ... never used it ... go ...go away ...
So my advise for the OP is MONO and MONOdevelop to be platform independent in development. If development is on windows use Visual Studio. Run Monodevelop to test for other client-platforms.
And use C# not VB.net. It pays off in the long run.
enjoy!
Mike
for the record, I've had a lot of luck with QB64 for prototyping. The learning curve was steep and the speed was reasonably fast. I also liked JustBASIC, but fell in love with QB64.
I tried and tried to use Python, but it just wasn't working for me at all...... and I WANTED to learn it.
LCC-Win32 has treated be well so far. This is what I'm trying to use for the real PC programming. I'm not sure if it's the wisest decision but it's working so far.
Oh, and I started learning SPIN for the Prop in all this. I was shocked how easy it was ...... not a computer programming language, but just for the record.... even though I think it's been a month since I've had microcontrollers out on my workbench.
I meant JB (Just Basic, as mentioned earlier in the thread).. Should make more sense now..
OBC
The original post requested a new programming language, moving from DOS. So comfort zone is with command line.
Suggestion: Check out CSP channels. My rig happens to have the PC side implemented in GO, and the Prop side implemented in propforth. But the PC side could just as easily be implemented in Python or C, and the prop side could just as easily be implemented in PASM, C or anything that runs on the prop. In fact, one of the really smart guys is strangely silent today, I expect there will be a non-forth implementation by Wednesday(?).
So result is the prop just runs a "firmware" or "bios" (wait, wait, hang on) that just gives ACCESS to the prop I/O resources, like the pins, or drivers that talk to the device hanging off the pins. The chunky, meaty part of the application can live on the pc, where you write your code in what ever environment suits you at the time.
Too much of stretch?
Ah yes, JB not JS.
Never heard if it but then I have never heard of many things.
Braino,
By the time you have chopped and changed languages at the PC end and then chopped and changed languages at the Prop/target end all you have left is a means of multiplexing many logical comms channels through a single physical link.
That is nothing to do with CSP as formalized by Tony Hoare and others. Please do not call it such.
What an audacious suggestion!
Ok, here is some javascript http://www.w3schools.com/js/js_popup.asp and like you say, you can "run" that program on any computer. Follow that link, try it, and click the button. It works!
Just in the last few days I have got some things working with the touchscreen that could do the button and the text. So the
runs a routine in Spin that takes a button image from the sd card and puts it on the screen (or displays it from ram if you want a faster display).
runs another routine that loads in the appropriate font and displays the text (centered) in the middle of the button.
Then you need to tell the touchscreen where the box is on the screen, so you can detect it being touched.
And finally display the alert box as a popup.
The cool thing is that all those routines are already written and working.
So what we need next is a parser to translate that javascript code and call the appropriate spin routines.
I took a look at some parsers and there are some written in C. So that should be possible with GCC or Catalina.
I'd be interested in seeing what that parser code actually looks like, ie the bit of code that chops up a line like
Javascript would be a cool language to build a GUI for the propeller as it would greatly aid debugging to also be able to run your program on any computer you like. Plus there is a version of pacman written in javascript that I want to get going. Lots of tile manipulation, which the propeller does really well.
addit: I'm looking at this new language with an unbiased newbie view - I've never coded in javascript. Those examples in the tutorial do not seem unfamiliar though.
While it takes a while to get the hang of the "perl way of programming" it's not a hard language to learn! I have to admit I tend to write my perl scripts so that they look a lot like perl. The big difference is that I use a lot of hashes!
I wouldn't mind using the visiual-x languages but I can't find any compilers for them that run under Linux or Solaris!!
Don't even think about it. It's a huge task and clearly impossible on the Propeller.
Most of what you were discussing in the post above was not JavaScript at all but HTML. So first you are going to need to build an HTML parser and renderer. That is the thing that is building your display of text, buttons etc etc.
I guess one could consider a severely limited parser/renderer that works on some HTML subset though.
The actual JavaScript there is the "function show_alert() { ... } that is embedded between HTML script tags. And the call to that function embedded in an HTML input elements attribute.
So now we are going to need another parser/compiler/interpreter for the JavaScript language itself. If you want one you can download the source code to Google's V8 JavaScript engine as used in their Chrome browser and the node.js system. The version I have here is almost two hundred thousand lines of C++!!!
Note 1: the draw() function defaults to looping.
Note 2: there exists a Processing.js for javascript programmers. I'm not sure if it exposes the serial ports or not.
Here's the .pde file:
This is very interesting and a great way to hook the Prop to the PC. Could you post the .SPIN code that is running on the QuickStart so we can see how the two hook together? I assume the "monitor" on the Prop is gathering and collecting data from the prop side and sending it across the serial link, it would be helpful to see your monitor code also.
Thanks!
Simply adds a count every 1/12 of a second and sends it to PST and then it just rolls over to 0 when it hits the maximum count. I'm not sure what you mean by prop "monitor". I'm substituting the running Processing program for the PST window.
In one earlier attempt I was monitoring the switches on the QS board using the same 8 P0 thru P7 outputs and the "Button Touch 2" from OBEX.
@ Eric. C# might be easier but I've never tried it. I've used JAVA some 25 years. It's whatever works for you.
Paul.