Pages: 1 2 [3]   Go Down
Author Topic: Is anyone using Forth in their Lilypad?  (Read 4938 times)
0 Members and 1 Guest are viewing this topic.
SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 133
Posts: 6749
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It sounds like amforth was ALMOST what Ian was looking for, but it seems very aimed at experienced developers interested in using existing forth programs, or using forth as a tool for writing very compact code, rather than as an interactive tool for relative beginners.  The whole idea of writing to flash each time a new word is defined makes me cringe :-(
With a custom dictionary (perhaps shadowing the arduino core libraries) and some additional paranoia and friendliness added, it might be more interesting.
Logged

London, GB
Offline Offline
Sr. Member
****
Karma: 8
Posts: 332
Nothing works.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks that way - that some languages aren't suited to separation of code and data (and indeed make the distinction quite strongly) that is inherent in a harvard architecture system.

The problem I want to solve is straightforward. I want a programming language that can be understood.
  • What I don't want is a language like C that nobody can make head or tail of for the entire duration of their projects — even the individuals that started off very interested and capable in computers.
  • I don't want them to spend their entire project just following along typing in or cutting & pasting things with no understanding of what they are doing, as long as they get the results promised.
  • I don't want them to get demoralised and feel inadequate when they experience nothing but errors and failures, because they have tried to mix and match existing programs.
  • I don't want them to end up leaving the unfinished mess of programming until the last minute in the hope that the requirement to make it work somehow will just go away.
  • I don't want them, on the other hand, to waste a completely disproportionate amount of time on the programming and still get nowhere, only to find that the time left for the important parts of their project has been eaten away now, making the overall quality and depth of their project suffer.
  • I don't want people to grind to a halt and run out of time on their projects, only having got as far as progressing it to the first rough with no further refinements in the design or creation due to lack of time (which is usually the case anyway even without adding ambient, ubiquitous  or just plain wearable computing to the mix of influences).
  • I want them to demonstrate their skills as artists and designers, producing whole projects with a good sense of innovative balance and distribution of effort across the time allotted, instead of encountering so many elephant traps — plunging into a black hole of struggling with finer points and technical refinements of a language for weeks on end — the value of which prove to be utterly irrelevant to the merits of their art and fashion design projects.
The contemporary designer wanting to incorporate some computer knowledge into their art has available some relatively refined languages that dispense with a lot of unnecessary tedious complication, focusing more on allowing the outward objective to be achieved rather than catering to how it should inwardly be accomplished. Web page design uses html, css — the more modern refinements of html5, css3 and javascript frameworks allow some quite powerful accomplishments in a short time span. Html offers the learner the necessary gratification of seeing results that actually do something (not necessarily the right thing) without simply refusing to do anything whatsoever until the correct magic words have been said in the right order in the right way. C is simply the wrong language for the Arduino, in the context and environment and audience that the Arduino is presented.
« Last Edit: December 11, 2010, 06:08:20 pm by u0421793 » Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 38
Turn it off!!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The problem I want to solve is straightforward. I want a programming language that can be understood.

C is very easy to understand most of the time, and to read, as long as you understand the basic concepts.  I even think it's easier to read than BASIC in most circumstances (just a personal opinion here, not looking to argue this one.)  A large number of programming languages are largely based on the C syntax because of this.  The brackets, curly brackets and parentheses are there to make it easier to read.  But you can't read it like a book.  Just like a microcontroller can't read an instructable and understand how to do it.

Quote
What I don't want is a language like C that nobody can make head or tail of for the entire duration of their projects — even the individuals that started off very interested and capable in computers.
    I don't want them to spend their entire project just following along typing in or cutting & pasting things with no understanding of what they are doing, as long as they get the results promised.
    I don't want them to get demoralised and feel inadequate when they experience nothing but errors and failures, because they have tried to mix and match existing programs.
    I don't want them to end up leaving the unfinished mess of programming until the last minute in the hope that the requirement to make it work somehow will just go away.
    I don't want them, on the other hand, to waste a completely disproportionate amount of time on the programming and still get nowhere, only to find that the time left for the important parts of their project has been eaten away now, making the overall quality and depth of their project suffer.
    I don't want people to grind to a halt and run out of time on their projects, only having got as far as progressing it to the first rough with no further refinements in the design or creation due to lack of time (which is usually the case anyway even without adding ambient, ubiquitous  or just plain wearable computing to the mix of influences).
    I want them to demonstrate their skills as artists and designers, producing whole projects with a good sense of innovative balance and distribution of effort across the time allotted, instead of encountering so many elephant traps — plunging into a black hole of struggling with finer points and technical refinements of a language for weeks on end — the value of which prove to be utterly irrelevant to the merits of their art and fashion design projects.

This makes it sound like you aren't interested in programming at all; only having the microcontroller do your will with human based commands.  I suggest you find a nice graphical user interface that has some scripting options.  I have never heard of a programming language (with the language at fault) where you have this much trouble with small programs, and if you don't understand the simple programs, you shouldn't be trying the larger programs first.  You seem to have an interest in the sewing aspect here, so here is a sewing example:  You wouldn't make a two layer sweater without knowing how to sew first.  While the easy sewing projects you start with aren't really what you want to do, and you might really hate doing them, you do them knowing that you need to understand them to complete your goal.

It takes time to understand any programming language, and it is easier for some people than others.  I helped teach a robotic programming class, I should know.

HTML and Javascript rely on computer powerful enough to run them properly, and the programs don't actually do most of the work themselves.  To program for a microcontroller, you have to actually do the low level stuff that those programs don't show you.  Even when you write in a high level language like BASIC for PICs, you still have to understand a lot of what the program is actually doing.  Sometimes some of the work can be gotten around by using frameworks that others have made.  Arduino is one of those frameworks.  Basic Stamp is another.  Saying that C/C++ is the wrong language for Arduino is a lot like arguing that sewing machines shouldn't use needles, but should use crochet hooks instead.  It wouldn't be a sewing machine anymore.  Using other languages on Arduino boards is similar to using sewing thread to crochet something.  It's not really sewing thread anymore, but crochet thread.  If you put forth on an Uno, your using it as just another project board.  Not a bad thing, but it's not really Arduino anymore.

I don't want to discourage you from programming Arduino, but I think you should know that that is what it is.  Programming.

If you want something that is more human readable, you may want to take a look at the PICAXE series of microcontrollers.  They have a free flowgraph based programming setup that is supposed to be really easy, and it would follow that it is very readable.  Or you could try to get Flowstone to work with your board (Which would require some normal programming anyway...)

BTW, there was some mention of semicolons not making sense at the end of lines.  They make sense because the completion of a line isn't where a microcontroller stops.  It continues on to the next line, which is still related somewhat, if for no other reason than it is also part of the C program.  So a semicolon make perfect sense.  Note that a C program is completed by a closing curly bracket.  Periods can't be used easily due to confusion with decimal points.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 133
Posts: 6749
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I want a programming language that can be understood.
yeah, you've said that.  Most of us are sitting here scratching our heads going "C is easy enough to understand"  as well as "C is a LOT easier to understand than Forth!"

I'm willing to allow for a lot of variation in the way that the human mind can work, and I'm willing to accept that YOU, personally, find Forth easier to understand than C.  But if you're talking about introducing  this to others...  You should be aware that the Arduino C subset HAS been successfully used by a lot of people that are not any more skilled of familiar with modern computer languages that your own target audience.  Quite  a few "Art" classes, in fact.  There are the Arduino Developer and "teacher" mailing lists (in addition to these forums), and I've gotta say that while there is much philosophy about how to extend the capabilities without passing the "usability" cliff, there is very little "This language is completely unsuitable for the people who need to use it."  Just you, in fact :-)  (That's not to say that people that agree with you don't just take a look and leave without saying anything, but...)

Maybe you should just bite the bullet and figure it out, whether you like it or not.  Then you can use the results of your experiences to better teach others.
« Last Edit: December 12, 2010, 03:29:05 am by westfw » Logged

London, GB
Offline Offline
Sr. Member
****
Karma: 8
Posts: 332
Nothing works.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interestingly, I tried Erlang for a few minutes (installed it on my Pogoplug plug computer running PlugApps linux). Surprisingly, the termination for end of statement in erlang is actually a full stop.
Logged

Central Europe
Offline Offline
Edison Member
*
Karma: 7
Posts: 1220
Use the Source, Luke.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In C they chose the semicolon (smiley-wink because the dot (.) was already used by floating point numbers. They wanted to keep the language parser simple.

Korman
« Last Edit: December 12, 2010, 12:41:48 pm by Korman » Logged

London, GB
Offline Offline
Sr. Member
****
Karma: 8
Posts: 332
Nothing works.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

…but not so simple it wouldn't get interpreted as a smiley.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, Forth. Such a nice language smiley

I was bored today and decided to implement a new Forth. It's still on its infancy (lacks if..else..then and repeat..until blocks, programs cannot be saved, etc), but it is promising.

Right now it works fine under a Atmega168 Seeeduino, using about 5kB of Flash (so we still got a lot of room for improvement). It does have a pretty simple virtual machine, so it should be slower than amforth.

I'm calling it FINF (FINF Is Not Forth), and making the code available under GPL2 on my Github account: https://github.com/lpereira/finf. Fork it and enjoy smiley
Logged

Pages: 1 2 [3]   Go Up
Jump to: