1. Easy Euphoria a Fairy tale
- Posted by andi49 May 27, 2015
- 4564 views
A Fairy Tale
I'am on Windows (no matter what Version, even Win7 or 8)
I like to learn a programming language.
Consider i found OpenEuphoria on the Web.
What do i find here (on OpenEuphoria.org)
I find some boilerplate (easy to learn, fast blahblahblah....)
What do i do next?
Download
What do i find? Eu4.0.5 from 2012 with an Editor from the early 80's
Okay, most people are off now. But i go on.
Oh, they have a wiki, let's see.
Ah, Frequently Ask questions...
What do i read mostly? 'Answer me'
Okay, not this worse...
I'am on Windows i like to program GUI programs (on Windows GUI is Basic I/O) ....
Okay, so i go to 'Absolute Beginners' (it's an easy to learn language!)...
They send me to 'Context text editor' why not... and then to the 'context highlighters...' damn page has vanished... okay, forget the rest.
But i really want to use this language, the advertising sounds too good.
Huh, there are links to 'Windows GUI Download' and 'Windows IDE Download'.
I'am really happy now. I have 2 zip files and i like them.
So far for this text:
Euphoria is a powerful but easy-to-learn programming language. It has a simple syntax and structure with consistent rules, and is also easy to read. You can quickly, and with little effort, develop applications, big and small, for Windows, Unix variants (Linux, FreeBSD, ...) and OS X.
A Fairy Tale
2. Re: Easy Euphoria a Fairy tale
- Posted by ChrisB (moderator) May 28, 2015
- 4512 views
Hi
Sorry you're having a bad newcomer experience. Current newcomers to programming expect (rightly so IMHO) everything to just be installed and work, whereas the old timers (myself included) and Linux programmers struggled to get things to work, as that was part of the appeal of computers and programming. This is one of my frustrations that hopefully is being currently addressed, so that there will be soon a complete package to download. in the meantime
http://jean-marc.duro.pagesperso-orange.fr/euphoria32.zip
http://jean-marc.duro.pagesperso-orange.fr/euphoria64.zip
are eminently functional - see http://openeuphoria.org/forum/128040.wc?last_id=128094 for details.
For the context highlighter (and hopefully this won't be necessary soon with the adding of WEE to the install package (at least this is my hope), it looks like the page was dropped. The highlighter for context can be found at http://www.contexteditor.org/highlighters/ and search for Euphoria. I chose Context as an example because its free, configurable and functional, but WEE definitely has the edge on it as far as Eu programming goes.
Do persevere with the language, we are a very helpful albeit small community, and there will always be someone to help answer even the seemingly most stupid of questions.
Chris
3. Re: Easy Euphoria a Fairy tale
- Posted by irv May 28, 2015
- 4468 views
Hi
Sorry you're having a bad newcomer experience.
He's hardly a newcomer, been posting here for about 4 years.
I think the points are well taken. AFAIK, other programming languages, such as Python, make no claims to be either easy or simple. Because programming is neither easy nor simple.
Anyone with programming experience is going to want to know why Euphoria is 'better' than what he or she is using. We do have some bragging points there. Why not forget the easy/simple claims, and emphasize the real advantages.
Anyone without programming experience is just going to complain when he picks up the computer mouse, and says into it: "Make me a game!", and no game appears.
We can't help those folks.
4. Re: Easy Euphoria a Fairy tale
- Posted by ChrisB (moderator) May 28, 2015
- 4430 views
Hi
Didn't realise he'd been around for 4 years. Learning to program takes some effort, I agree, but there should be as small a first step as we can possibly make it.
Anyone without programming experience is just going to complain when he picks up the computer mouse, and says into it: "Make me a game!", and no game appears.
We can't help those folks.
And there's an opportunity missed Irv.
Chris
5. Re: Easy Euphoria a Fairy tale
- Posted by _tom (admin) May 28, 2015
- 4462 views
A Fairy Tale
Thanks for the checklist of things I should be working on.
More importantly, thanks for tinEWG.
The essence of what o[ needs has been solved by Andreas Wagner.
http://euphoria.indonesianet.de/
You get: oE install, UI, editor, and designer.
Sorry about the delay in recognizing what you have accomplished.
(I actively avoid using Windows so it does take a year or two to catch up.)
_tom
6. Re: Easy Euphoria a Fairy tale
- Posted by jimcbrown (admin) May 28, 2015
- 4460 views
I actively avoid using Windows
_tom
Ditto.
7. Re: Easy Euphoria a Fairy tale
- Posted by ghaberek (admin) May 28, 2015
- 4485 views
I think the points are well taken. AFAIK, other programming languages, such as Python, make no claims to be either easy or simple. Because programming is neither easy nor simple.
This is absolutely correct. Euphoria is easy to use (for programmers). Programming itself inherently difficult.
No Silver Bullet explains that certain aspects of programming contain essential complexity that cannot be avoided.
Anyone with programming experience is going to want to know why Euphoria is 'better' than what he or she is using. We do have some bragging points there. Why not forget the easy/simple claims, and emphasize the real advantages.
Sequences are incredibly powerful and easy to use. I think we need to do a better job of leveraging that in our propaganda.
-Greg
8. Re: Easy Euphoria a Fairy tale
- Posted by jmduro May 28, 2015
- 4447 views
For the context highlighter (and hopefully this won't be necessary soon with the adding of WEE to the install package (at least this is my hope), it looks like the page was dropped. The highlighter for context can be found at http://www.contexteditor.org/highlighters/ and search for Euphoria. I chose Context as an example because its free, configurable and functional, but WEE definitely has the edge on it as far as Eu programming goes.
Does anyone have the source files of ConTEXT? It is not available on GoogleCode (SVN tells path not found). It has not been updated since 2009.
9. Re: Easy Euphoria a Fairy tale
- Posted by BRyan May 28, 2015
- 4421 views
Does anyone have the source files of ConTEXT? It is not available on GoogleCode (SVN tells path not found). It has not been updated since 2009.
It is in the aechive.
Bernie
10. Re: Easy Euphoria a Fairy tale
- Posted by jmduro May 28, 2015
- 4423 views
It is in the aechive.
Bernie
Thank's Bernie, but I see only syntax files not source files (Borland Delphi) to port it on Lazarus and let it get maintained.
11. Re: Easy Euphoria a Fairy tale
- Posted by ghaberek (admin) May 28, 2015
- 4430 views
Thank's Bernie, but I see only syntax files not source files (Borland Delphi) to port it on Lazarus and let it get maintained.
Go to contexteditor on Google Code. Click Source. Click Browse. The latest source is under svn/0.99.x/src.
-Greg
12. Re: Easy Euphoria a Fairy tale
- Posted by BRyan May 28, 2015
- 4395 views
Thank's Bernie, but I see only syntax files not source files (Borland Delphi) to port it on Lazarus and let it get maintained.
DOWN LOAD FROM: http://tortoisesvn.net/ TortoiseSVN-1.8.11.26392-win32-svn-1.8.13.msi DO A CHECKOUT OF SOURCE FROM HERE: http://contexteditor.googlecode.com/svn
13. Re: Easy Euphoria a Fairy tale
- Posted by irv May 28, 2015
- 4368 views
Speaking of Lazarus:
I created a little program consisting of a window and a button, which closes the program when clicked.
Results:
Lazarus created 16 source files, and the complied runtime was 19.1 megs. EuGTK created the same program with 1 source file, runtime 2.1 megs.
Both are compiled, so they start up with the same observable speed. Appearance is exactly the same.
14. Re: Easy Euphoria a Fairy tale
- Posted by GreenEuphorian May 28, 2015
- 4391 views
In short, I fully agree with what andi49 said.
<rant>
In my case, I could never go past the stage of beginner precisely because of the lack of resources and the poor and stagnant ecosystem which is around Euphoria.
Don't get me wrong, Euphoria IS a nice and lovely language, and it is easy and powerful too. BUT how do you expect people to learn and adopt it if you don't make things easy for them? When there are practically no resources for beginners?
Now, there is a manual, there are lots of code examples at Rosetta code, and there is a lot of code the the Archive. And yet, none of this caters for the needs of a beginner, apart for the manual, which BTW is extremely terse and technical. What we would really need is a book, with an up-to-date Euphoria programming course.
Oh yes, you may find brief articles or webpages which teach you Euphoria's basic constructs (which you will learn in three days or less), but beyond that point... nothing. The website's Wikis, which were meant to contain something of this kind, are all but deserted.
Beginners are unable to benefit from the massive amount of code stored in the Archives, because there is a stepping stone which is missing: some nice tutorial which explains how Euphoria works, possibly featuring a real mid-sized program, with commented code. That is, something which takes you by hand and explains to you how the language works. How else is a beginner expected to learn?
Moreover, most of the people who post on this website are old-timers, with in-depth knowledge of Euphoria's inner workings. Most of the posts are quite technical. Sorry about this, but they seem oblivious to the beginners' needs.
It was suggested in the past that we may have a beginners' section on this forum. But, come to think about it, who would post in it? There are practically no beginners. I am one of them, and I am sticking around hoping that things will change in the future. Hoping in an expansion of the Euphoria's ecosystem... which would make things a bit more approachable and friendly to beginners.
</rant>
15. Re: Easy Euphoria a Fairy tale
- Posted by Spock May 28, 2015
- 4363 views
Speaking of Lazarus:
I created a little program consisting of a window and a button, which closes the program when clicked.
Results:
Lazarus created 16 source files, and the complied runtime was 19.1 megs. EuGTK created the same program with 1 source file, runtime 2.1 megs.
Both are compiled, so they start up with the same observable speed. Appearance is exactly the same.
Two days ago I d/l Mic's Forth compiler [for inspiration] and try out some examples. One of them is a plain window (I'm sure a button could be added to it). Startup time essentially instant, file size, uh, 3K. Sure, who wants to program in Forth? On the other hand...
Spock
16. Re: Easy Euphoria a Fairy tale
- Posted by irv May 28, 2015
- 4333 views
.386 .MODEL FLAT, STDCALL INCLUDELIB USER32.LIB MessageBoxA PROTO :DWORD, :DWORD, :DWORD, :DWORD INCLUDELIB KERNEL32.LIB ExitProcess PROTO :DWORD .CODE Heading DB "Ian's Message Box", 0 Text DB "Hello, World", 0 Main: INVOKE MessageBoxA, 0, OFFSET Text, OFFSET Heading, 0 INVOKE ExitProcess, 0 END Main
Runtime: 1.5k.
But as you say, who wants to program in assembly language?
17. Re: Easy Euphoria a Fairy tale
- Posted by Spock May 28, 2015
- 4381 views
In my case, I could never go past the stage of beginner precisely because of the lack of resources and the poor and stagnant ecosystem which is around Euphoria.
Don't get me wrong, Euphoria IS a nice and lovely language, and it is easy and powerful too. BUT how do you expect people to learn and adopt it if you don't make things easy for them? When there are practically no resources for beginners?
Although someone might try to deny it the new manual basically was written by experts for experts. In the early 90's all I had was the RefMan and the toy examples which I ran from ed.ex in order to learn the language. Once I "got it" I was away. Why don't you just d/l an old copy of Euphoria and study the RefMan in it? The other thing you'll need is time..
Spock
18. Re: Easy Euphoria a Fairy tale
- Posted by irv May 28, 2015
- 4316 views
Does it bother anyone that the assembly language example is easier to understand (even if you've never done any before) than higher-level windows programming? Somebody want to post the equivalent using win32lib, just for comparison?
19. Re: Easy Euphoria a Fairy tale
- Posted by Spock May 28, 2015
- 4394 views
Does it bother anyone that the assembly language example is easier to understand (even if you've never done any before) than higher-level windows programming? Somebody want to post the equivalent using win32lib, just for comparison?
include ARWEN.ew MessageBox( "Demo", "Hello" )
Can't help with win32lib code, sorry.
Spock
20. Re: Easy Euphoria a Fairy tale
- Posted by fizzpopsoft May 29, 2015
- 4283 views
As mentioned previously, programming is essentially not easy - not everyone has the talent for it. If we are to justify the assertion that Euphoria is easy, with examples, then those examples need to be at a certain level of understanding for the beginner.
OK, if the examples start with "Source code = your program, gets read by the computer language parser from top to bottom, left to right...."
Or "Variables are names that hold the contents of storage that you change in your program..."
Or "The difference between global, public and private variables is...."
Or "You may not say 'X = X + 1' unless the computer already knows the value of X before its adds one...."
Then later on, perhaps there may be advice like:"
"Use private variables instead of public or global wherever possible, because..."
"Break down what needs to be done, into small blocks of code not exceeding one visible page.."
"Indent your code, so that the line underneath a 'if' statement starts 2 spaces to the right of the 'if' ....
"The difference between a procedure and a function, is that a function returns...."
Etc, etc.... these are talking about general programming principles, best practices, which are common to most languages. Thats not Euphoria specific. Possibly this is what the complete beginner needs, but the point is, its not Euphoria specific.
IMHO the ideal beginners guide to Euphoria would have many Euphoria examples with lots of comments, using a "plonkable" GUI package.
Very important that the "plonkable" (wrapper) library is essentially bug-free that the beginner does not need to dig around or make changes to it.
If one looks at the demo's with the win32lib v020.7 I think, that should be a great start. BTW, there was a "Beginners guide to Euphoria" by David Gay IIRC. Maybe links to this and similar work already done, could be mentioned in a "beginners" section on the downloads page?
21. Re: Easy Euphoria a Fairy tale
- Posted by jmduro May 29, 2015
- 4331 views
Go to contexteditor on Google Code. Click Source. Click Browse. The latest source is under svn/0.99.x/src.
-Greg
Thank you Greg. I know I can browse source code file by file, but I wanted the complete set at once and SlikSVN didn't find the URL.
Jean-Marc
22. Re: Easy Euphoria a Fairy tale
- Posted by jmduro May 29, 2015
- 4279 views
DOWN LOAD FROM: http://tortoisesvn.net/ TortoiseSVN-1.8.11.26392-win32-svn-1.8.13.msi DO A CHECKOUT OF SOURCE FROM HERE: http://contexteditor.googlecode.com/svn
Thank you Bernie. TortoiseSVN did the job where SlikSVN failed to do. I will remove the latter from my PC.
Jean-Marc
23. Re: Easy Euphoria a Fairy tale
- Posted by irv May 29, 2015
- 4250 views
There's a lot of discussion about the need for a 'plonkable' GUI package to make programming easy for the masses of unwashed would-be programmers out there.
So here's my challenge:
Using the language and 'plonker' of your choice, write and post the code and exe for a program which actually does something useful - a text editor, a point-of-sale program (enter item description and price, have tax and total computed, print receipt), or other program of that scale. Opening a window and displaying "Hello World" isn't really a very good test, you know. It's what happens after you display the window where things begin to get complicated for the programmer (whether beginner or expert).
You don't have to write one especially for this purpose. You could just post some old program you have written, even years ago, just as long as it was , er, 'plonked' and you found that it was easy to write.
We can then vote on which one would be the easiest for a newcomer, and we can put together a Euphoria download that will be as easy - or easier, if possible.
Having a definite goal to work toward would allow for some actual progress.
24. Re: Easy Euphoria a Fairy tale
- Posted by _tom (admin) May 29, 2015
- 4296 views
...snip...
BTW, there was a "Beginners guide to Euphoria" by David Gay IIRC. Maybe links to this and similar work already done, could be mentioned in a "beginners" section on the downloads page?
I updated ABGTE as a pdf. David Gay, the original author expressly states that his work should not be edited. As a result the best I could do to "update" his work was to add some annotations in the margins.
http://www.rapideuphoria.com/abg_pdf.zip
A generic introduction to programming is Think Euphoria. This is a work by Allen Downey, which I converted from Python to Euphoria; Downey generously make his book open source so this editing is allowed.
http://www.rapideuphoria.com/thinkeuphoria.zip
The wiki now has links to these books.
I have started an introduction to Euphoria book with maybe 50 pages so far. But, any sane person would tell me to go fishing instead...or maybe birdwatching.
_tom
25. Re: Easy Euphoria a Fairy tale
- Posted by GreenEuphorian May 29, 2015
- 4230 views
I have started an introduction to Euphoria book with maybe 50 pages so far. But, any sane person would tell me to go fishing instead...or maybe birdwatching.
Does it include the case study of a real program? You see, there are lots of teaching resources on the basic structures and functions of Euphoria, on the sequences, etc.
What we need now is a programming tutorial that builds a Euphoria program step-by-step. From the preliminary phase (design) to the actual implementation. With a commented analysis of the code. Something like an rudimentary airline booking system, or a home library database would be nice. BTW the program could also be one of those already present in the Archive.
Can anyone suggest an already existing program which could be suitable for this purpose? Maybe one you wrote yourself, and used in a commercial environment.
26. Re: Easy Euphoria a Fairy tale
- Posted by _tom (admin) May 29, 2015
- 4225 views
Does it include the case study of a real program? You see, there are lots of teaching resources on the basic structures and functions of Euphoria, on the sequences, etc.
The idea is to create a Programming 101, similar to an introductory book on programming in a "first course" of programming in any language. You are already past this stage, but I have to start with baby steps.
I am not ready to create a Programming 201 that would involve some case study.
What we need now is a programming tutorial that builds a Euphoria program step-by-step. From the preliminary phase (design) to the actual implementation. With a commented analysis of the code. Something like an rudimentary airline booking system, or a home library database would be nice. BTW the program could also be one of those already present in the Archive.
Can anyone suggest an already existing program which could be suitable for this purpose? Maybe one you wrote yourself, and used in a commercial environment.
The starting point is: what are you trying to do?
I suggest you start a project and describe it to us. As you get stuck|frustrated ask questions. Ultimately, your project could get written up as a tutorial.
_tom
27. Re: Easy Euphoria a Fairy tale
- Posted by irv May 29, 2015
- 4227 views
That is what I had in mind.
We choose one - or perhaps several - existing programs. They don't need to be extensively commented - anyone on this forum can copy a line or a function from that program, and ask for an explanation. Those explanations (the ones which are most clear and correct, anyway) are then added as comments in the source.
Rinse, repeat...
Shouldn't take long before the entire thing is commented well enough so that a beginner can follow it.
28. Re: Easy Euphoria a Fairy tale
- Posted by petelomax May 29, 2015
- 4189 views
One thing I was going to try was a simpler version of Microsoft Visio. For those that don't know, it is like Word but for simple diagrams and flowcharts: starting with a blank page you can draw boxes, text, and lines, and drag them about. Boxes can be resized by dragging the corners. Text belongs in a box and moves with it. All boxes have 3 or more anchor points on each side and any line that starts/ends on such moves when you move the box. Lines can have arrow heads at each end and always have 3 anchor points which can be dragged to the desired shape with a curve fitting algorithm. I think (it has been a while) if you need more anchor points you can just link up several lines. Anchors and drag handles only appear when you hover the mouse over them. You can zoom in and out when editing. There are a few clones about, but I never found anything good, including Microsoft Visio. Anyway, if you needed an idea...
Pete
PS: Of course Visio has like 487 different shapes and 94 kinds of line and 37 different arrow heads all arranged into 300-odd industry-specific classes. Something an awful lot simpler ought to be fairly easy to write, and ought to be somewhat easier to use!
29. Re: Easy Euphoria a Fairy tale
- Posted by ryanj May 29, 2015
- 4176 views
One thing I was going to try was a simpler version of Microsoft Visio. For those that don't know, it is like Word but for simple diagrams and flowcharts: starting with a blank page you can draw boxes, text, and lines, and drag them about. Boxes can be resized by dragging the corners. Text belongs in a box and moves with it. All boxes have 3 or more anchor points on each side and any line that starts/ends on such moves when you move the box. Lines can have arrow heads at each end and always have 3 anchor points which can be dragged to the desired shape with a curve fitting algorithm. I think (it has been a while) if you need more anchor points you can just link up several lines. Anchors and drag handles only appear when you hover the mouse over them. You can zoom in and out when editing. There are a few clones about, but I never found anything good, including Microsoft Visio. Anyway, if you needed an idea...
Pete
PS: Of course Visio has like 487 different shapes and 94 kinds of line and 37 different arrow heads all arranged into 300-odd industry-specific classes. Something an awful lot simpler ought to be fairly easy to write, and ought to be somewhat easier to use!
I was actually planning to write a drawing program similar to that for many years, but never felt like i had the appropriate libraries and experience to do it. It seems to be difficult to make a large program and requires proper programming techniques, good organization of source code, and a powerful enough set of gui and graphics libraries.
I think it is finally possible for me to write something like that, because Redy has been designed (or rather, is still being designed) for this sort of thing in mind. The "canvas" widget class allows you to draw graphics as well as handles (mouse event capture areas) in any shape you wish, using a simple sequence-based drawing "language". Entire libraries can be written to control "objects" on a canvas, effectively defining custom widgets, document editors, etc. An application support library will make it easy to store application preferences, manage commands with undo/redo, manage communication between multiple tasks, processes (to make up for lack of multi-threading), and modules, using techniques such as queues, messaging, publish/subscribe, etc. A system of toolbars and panels in the widget library with a complete set of toolbar icons will help make the app more "professional". I intend to make a few programs to demonstrate (and experiment with) these concepts. It would be interesting to discuss some of these ideas and programming techniques (not necessarily within the context of Redy).
30. Re: Easy Euphoria a Fairy tale
- Posted by Icy_Viking May 29, 2015
- 4200 views
In short, I fully agree with what andi49 said.
<rant>
In my case, I could never go past the stage of beginner precisely because of the lack of resources and the poor and stagnant ecosystem which is around Euphoria.
Don't get me wrong, Euphoria IS a nice and lovely language, and it is easy and powerful too. BUT how do you expect people to learn and adopt it if you don't make things easy for them? When there are practically no resources for beginners?
Now, there is a manual, there are lots of code examples at Rosetta code, and there is a lot of code the the Archive. And yet, none of this caters for the needs of a beginner, apart for the manual, which BTW is extremely terse and technical. What we would really need is a book, with an up-to-date Euphoria programming course.
Oh yes, you may find brief articles or webpages which teach you Euphoria's basic constructs (which you will learn in three days or less), but beyond that point... nothing. The website's Wikis, which were meant to contain something of this kind, are all but deserted.
Beginners are unable to benefit from the massive amount of code stored in the Archives, because there is a stepping stone which is missing: some nice tutorial which explains how Euphoria works, possibly featuring a real mid-sized program, with commented code. That is, something which takes you by hand and explains to you how the language works. How else is a beginner expected to learn?
Moreover, most of the people who post on this website are old-timers, with in-depth knowledge of Euphoria's inner workings. Most of the posts are quite technical. Sorry about this, but they seem oblivious to the beginners' needs.
It was suggested in the past that we may have a beginners' section on this forum. But, come to think about it, who would post in it? There are practically no beginners. I am one of them, and I am sticking around hoping that things will change in the future. Hoping in an expansion of the Euphoria's ecosystem... which would make things a bit more approachable and friendly to beginners.
</rant>
I've always thought a book on Euphoria would be nice. It would be helpful for beginners. I know there is A Beginner's Guide To Euphoria and another called Euphoric Mysteries. Of course what we'd need is an up to date book on Euphoria, something covering Euphoria 4.0.5 or 4.1.0, one that covers the new features added to Euphoria. I've had ideas for writing a book myself. I also think a beginner's section would also be good for Euphoria.
31. Re: Easy Euphoria a Fairy tale
- Posted by fizzpopsoft May 30, 2015
- 4163 views
I have two requests from a buddy, that could be candidates of a sample Euphoria program:
An inventory of electronic parts. The buddy is always buying more components because he cannot remember where/if he has stored existing parts.
I was thinking a database, but why reinvent the wheel, the parts have datasheets (pdf). So just read in a directory containing the datasheets, then prompt the user as to where they are, and how many. The user search is by part number (pdf filename prefix).
Maybe chuck in some inventory printing. Store the number of parts in a text file.... or a Euphoria database?
Calculating power requirements. The buddy wants to walk in each room of a customer home, note what lighting type and wattage is being used, also stove, geyser etc. The program will determine highpoint of consumption. Then produce scenarios, where if gas stove is used, if solar panels are used, with / without UPS or generator, and of course the approx cost of each scenario.
There is considerable demand in South Africa for those wanting to go "off the grid" due to daily "loadshedding" aka blackouts, btw. But this could be useful for other regions of lesser demand. Maybe the program could even be commercial, with sales going to the Euphoria donations ;)
32. Re: Easy Euphoria a Fairy tale
- Posted by petelomax May 30, 2015
- 4137 views
We choose one - or perhaps several - existing programs.
What about Wee? It would be quite nice to have something that explains how to design and develop such a program from scratch.
Pete
33. Re: Easy Euphoria a Fairy tale
- Posted by jimcbrown (admin) May 30, 2015
- 4123 views
We choose one - or perhaps several - existing programs.
What about Wee? It would be quite nice to have something that explains how to design and develop such a program from scratch.
Pete
Seconded!
34. Re: Easy Euphoria a Fairy tale
- Posted by BRyan May 30, 2015
- 4108 views
One thing I notice about new forum users is they think that the forum is used to
ask for someone to write a program for them; giving all their specs. and requirements.
A lot of them do not try to initiate the will to try something on their own.
Their are thousands of lines of code in the archive that some how are being ignore.
They can always find some code that is near to any project that they are considering.
Use it as starting point; adding code to it; modifying the code; etc.
1. Get an idea of what you want to accomplish.
2. Look in archive for similar code or program.
3. Modify the code to perform the way you want it to.
4. USE YOUR IMAGINATION
5. Then you will understand Euphoria and how to use it.
Bernie
35. Re: Easy Euphoria a Fairy tale
- Posted by GreenEuphorian May 30, 2015
- 4146 views
One thing I notice about new forum users is they think that the forum is used to
ask for someone to write a program for them; giving all their specs. and requirements.
A lot of them do not try to initiate the will to try something on their own.
Their are thousands of lines of code in the archive that some how are being ignore.
They can always find some code that is near to any project that they are considering.
Use it as starting point; adding code to it; modifying the code; etc.
1. Get an idea of what you want to accomplish.
2. Look in archive for similar code or program.
3. Modify the code to perform the way you want it to.
4. USE YOUR IMAGINATION
5. Then you will understand Euphoria and how to use it.
Bernie
Sorry Bernie, but you are missing the point of what I was saying. The objective was not getting a program written for you. It was learning how to program through the study of a program written by someone else, because a beginner naturally wouldn't be able to write it for himself. And, as I mentioned, the programs in the Archive *as they are* (i.e. uncommented) are not much suitable for this purpose. But of course some of them could be used in a programming tutorial. They key here is the explanation of the code (and of the overarching program design, of course).
36. Re: Easy Euphoria a Fairy tale
- Posted by irv May 30, 2015
- 4089 views
OK, I have made a web page describing step by step how to write a simple program which baffles many applicants for computer programming jobs, but is explained well enough for a beginner Eu programmer to understand.
Where (and how) do I post it? No images are involved, just html.
37. Re: Easy Euphoria a Fairy tale
- Posted by jimcbrown (admin) May 30, 2015
- 4096 views
OK, I have made a web page describing step by step how to write a simple program which baffles many applicants for computer programming jobs, but is explained well enough for a beginner Eu programmer to understand.
Where (and how) do I post it? No images are involved, just html.
If you want it hosted on the openeuphoria.org website, then just mail it via the contact admin link and I'll set it up from there.
38. Re: Easy Euphoria a Fairy tale
- Posted by irv May 30, 2015
- 4093 views
Sent.
I do have admin rights to OE, I'll try to figure out how to do this myself eventually.
Thanks.
39. Re: Easy Euphoria a Fairy tale
- Posted by jimcbrown (admin) May 30, 2015
- 4096 views
Sent.
Thanks.
Thank you, it's now available here:
http://openeuphoria.org/fizzbuzz.html
I do have admin rights to OE, I'll try to figure out how to do this myself eventually.
A higher level of access (an SSH account) is required to actually be able to perform uploads.
40. Re: Easy Euphoria a Fairy tale
- Posted by fizzpopsoft May 31, 2015
- 4081 views
That example from Irv is cool! Between the lines is the subtle RTFM or "Read the friendly manual" too ;)
41. Re: Easy Euphoria a Fairy tale
- Posted by irv May 31, 2015
- 4035 views
That example from Irv is cool! Between the lines is the subtle RTFM or "Read the friendly manual" too ;)
And, ahem... between THOSE lines I tried to subtly hint that TFM could be a bit more Friendly to newcomers :)
42. Re: Easy Euphoria a Fairy tale
- Posted by fizzpopsoft May 31, 2015
- 4023 views
Kinda chicken and egg situation... if you don't know the difference between print and printf, you need to guess and find another command similar to print in order to find printf :(
At least linux has a ( how will you know of it) obscure command "apropos" to find man references to unix commands, that might put you on the right path.
OK, to be fair though, the Euphoria reference manual does have lots of "see also" type assistance for related subjects so its not so bad IMHO.
Reading manuals is a good thing... I often find stuff that sticks in "main storage" = my memory, while looking for something unrelated, but that rings a bell later when I need it.
43. Re: Easy Euphoria a Fairy tale
- Posted by irv May 31, 2015
- 4040 views
You're right, of course. And actually, making the Eu docs 'friendlier' wouldn't help all that much, since they are - simply because of the size - intimidating.
Even David Gay's "A Beginners Guide", as annotated by Tom C. is pretty big, 200+ pages.
And they aren't geared toward 'teaching programming', anyway. You need to know the concepts already before the above documents will make much sense to you.
A newcomer to programming - or, for that matter, a newcomer to Eu (but veteran of other programming languages) just wants to do something now. IOW, to see some results.
You perhaps remember the excitement of 'writing' your first program - actually, you probably just copied some code from the web (or, if you're old enough, a book) - probably a Basic loop to print the numbers from 1 to 10.
Even someone with years of experience with a dozen different languages is going to want to try something similar. In my case, if a 1...10 loop takes 30 lines of code and a lot of strange squiggly characters to make it work, that's enough to make me look elsewhere. On the other hand, if a language has a feature that makes a common task much easier than other languages I've used, I may be impressed enough to give it a try.
Isn't that what we want: to attract newcomers to Eu, and to convince seasoned programmers to try Eu?
So I suggest a series of simple demo programs - 1 to 20 lines or so - with extensive step-by-step explanation. Anyone could contribute. One person could volunteer to format them neatly so the appearance would be uniform. Make them available here. Preferably each demo should illustrate some Eu feature that makes it stand out from the crowd.
44. Re: Easy Euphoria a Fairy tale
- Posted by GreenEuphorian May 31, 2015
- 3969 views
Isn't that what we want: to attract newcomers to Eu, and to convince seasoned programmers to try Eu?
Apparently not.
45. Re: Easy Euphoria a Fairy tale
- Posted by ne1uno May 31, 2015
- 3989 views
Isn't that what we want: to attract newcomers to Eu, and to convince seasoned programmers to try Eu?
Apparently not.
the home page shows code snippits.
lack of a steady stream of complaints from people exposed to the language for the first time leads to a few guesses. the documentation and packaging is fine. we know this isn't always true. there is simply less people curious enough to look for a new language or like in my case, found a bit of euphoria code in an archive that performed a job well and I had to know more about the language. we could be preaching to the choir? publish some code, spread it around.
we also know, not everyone that has problems will take the time to post about it and not everyone that has a good experience will stick around long for a variety of reasons. you'd think a few would now & then. there is enough blame to go around, but it may be more than docs and packaging can fix.
programming is difficult as has been pointed out. bad programs can cause problems and make you crazy. maybe everyone shouldn't do it?
]
46. Re: Easy Euphoria a Fairy tale
- Posted by AndyDrummond Jun 01, 2015
- 3942 views
Does it bother anyone that the assembly language example is easier to understand (even if you've never done any before) than higher-level windows programming? Somebody want to post the equivalent using win32lib, just for comparison?
include ARWEN.ew MessageBox( "Demo", "Hello" )
Can't help with win32lib code, sorry.
Spock
I just wrote an instant "Click me!" single button window using Judith's IDE and therefore Win32Lib. It took me, oh, thirty seconds to write, run, compile. The clickme.exw file is 1k long, but the executable clickme.exe is - Woe! - 300k long. But I can write thousands of lines of code and almost never get an executable of larger than a meg.
I do agree, though, that to offer someone Euphoria is a nightmare. We need a simple document saying where to get what, where to install it, how to run it, and then maybe they can run with it. I only use Windows ( don't tell me I'm a masochist ) but with Win32Lib (and EuVIDE) I find it very simple. Never need to look up arguments and variable sizes; just setText() or setWindowBackColor() and so on. Unix is too much like going back to MS-DOS in terms of getting too close to the OS and even the hardware to have time to do a proper job designing the actual application requirement. IMHO.
You will disagree, I know, don't bother to tell me I don't know what I'm talking about!
The exw program comes out as:
include Win32lib.ew constant Window1 = createEx( Window, "Window1", 0, Default, Default, 214, 161, 0, 0 ) constant ClickMe = createEx( PushButton, "Click me!", Window1, 50, 40, 90, 30, 0, 0 ) -------------------------------------------------------------------------------- procedure ClickMe_onClick (integer self, integer event, sequence params)--params is () abort(0) end procedure setHandler( ClickMe, w32HClick, routine_id("ClickMe_onClick")) --------------------------------------------------------- WinMain( Window1,Normal )
A bit verbose compared to Arwen above, but I could have put a message box instead of a pushbutton with much the same result:
include Win32Lib.ew constant Window1 = createEx( Window, "Window1", 0, Default, Default, 214, 161, 0, 0 ) -------------------------------------------------------------------------------- VOID = message_box("Click me if you dare!", "Test", MB_ICONEXCLAMATION) abort(0) --------------------------------------------------------- WinMain( Window1,Normal )
Of course, you could just use this:
include Win32Lib.ew VOID = message_box("Click me if you dare!", "Test", MB_ICONEXCLAMATION)
But that is getting a tad silly. Though it ties up 100% with the Arwen code....
47. Re: Easy Euphoria a Fairy tale
- Posted by euphoric (admin) Jun 01, 2015
- 3913 views
OK, I have made a web page describing step by step how to write a simple program which baffles many applicants for computer programming jobs, but is explained well enough for a beginner Eu programmer to understand.
Where (and how) do I post it? No images are involved, just html.
Why not just create a wiki page?
48. Re: Easy Euphoria a Fairy tale
- Posted by ghaberek (admin) Jun 01, 2015
- 3915 views
I just want to point out that if you want to exit a Win32Lib app, you should call closeApp() and not abort(). The same can be achieved with exit_main() in wxEuphoria.
include Win32Lib.ew constant Window1 = createEx( Window, "Window1", 0, Default, Default, 214, 161, 0, 0 ) constant ClickMe = createEx( PushButton, "Click me!", Window1, 50, 40, 90, 30, 0, 0 ) -------------------------------------------------------------------------------- procedure ClickMe_onClick (integer self, integer event, sequence params)--params is () VOID = message_box("Click me if you dare!", "Test", MB_ICONEXCLAMATION) closeApp() end procedure setHandler( ClickMe, w32HClick, routine_id("ClickMe_onClick")) --------------------------------------------------------- WinMain( Window1,Normal )
-Greg
49. Re: Easy Euphoria a Fairy tale
- Posted by ghaberek (admin) Jun 01, 2015
- 3967 views
Why not just create a wiki page?
Or a even whole wiki? I would gladly accept some help with expanding the articles on usingEuporia.com.
I have already drawn out a pretty substantial outline. I can create accounts for anyone willing to assist.
-Greg
50. Re: Easy Euphoria a Fairy tale
- Posted by euphoric (admin) Jun 01, 2015
- 3954 views
Why not just create a wiki page?
Or a even whole wiki? I would gladly accept some help with expanding the articles on usingEuporia.com.
I have already drawn out a pretty substantial outline. I can create accounts for anyone willing to assist.
-Greg
Greg, send me some account credentials and I'll help when I can. Do you have copies of the two booklets I wrote up for the old site? I might have those still around here somewhere. Might be a good scaffolding for further development.
51. Re: Easy Euphoria a Fairy tale
- Posted by ghaberek (admin) Jun 01, 2015
- 3962 views
Greg, send me some account credentials and I'll help when I can.
You should receive a notification with your account credentials. Check your spam folder.
Do you have copies of the two booklets I wrote up for the old site? I might have those still around here somewhere. Might be a good scaffolding for further development.
I think I have the original "EGI" files you had sent me a while ago. I have not looked at them very much so I am not too familiar with their inner-workings.
I believe that system would have to be put back in place to properly display the content, unless you want to pluck out the content manually.
I currently only have the server configured to do rewrite exclusively for DokuWiki. I would have to make some changes to the settings to allow other content to be hosted.
-Greg
52. Re: Easy Euphoria a Fairy tale
- Posted by irv Jun 01, 2015
- 3916 views
Unix is too much like going back to MS-DOS in terms of getting too close to the OS and even the hardware to have time to do a proper job designing the actual application requirement. IMHO.
I am sure you do know what you're talking about.
I just wonder if you have tried Linux recently.
53. Re: Easy Euphoria a Fairy tale
- Posted by ghaberek (admin) Jun 01, 2015
- 3949 views
Unix is too much like going back to MS-DOS in terms of getting too close to the OS and even the hardware to have time to do a proper job designing the actual application requirement. IMHO.
I am sure you do know what you're talking about. I just wonder if you have tried Linux recently.
I use Ubuntu 14.04 as my primary machine at home and I encounter very few instances where I have to get "down to the metal".
It doesn't seem that I have to do this any more than I would have on my previous Windows 7 machine.
Lately I've been working on a project written in C++ with wxWidgets using CodeLite.
There were a few minor "gotchas" but now I can develop and build the same project on Linux or Windows without having to touch the command line.
-Greg
54. Re: Easy Euphoria a Fairy tale
- Posted by irv Jun 01, 2015
- 3876 views
The only time I really use the command line (other than experimenting) is to install new programs. It's quicker for me to type 4 words than to browse around websites looking for a download link. Probably safer, too, come to think of it. apt goes straight to the source, while a link might be fake, or make me wade thru a bunch of ad pages, or ?
55. Re: Easy Euphoria a Fairy tale
- Posted by Bazzadude Jun 01, 2015
- 3900 views
Right, I'd even say some linux desktop environments like Cinnamon and Unity (each with their respective strengths and weaknesses) provide a far more intuitive experience than some other mainstream OSs.
56. Re: Easy Euphoria a Fairy tale
- Posted by jmduro Jun 01, 2015
- 3893 views
KDE is my favorite on Linux Mint. With a bit of wxEuphoria code, only a small subset of it, I can run programs on both Linux and Windows with close look and feel. Jean-Marc
57. Re: Easy Euphoria a Fairy tale
- Posted by euphoric (admin) Jun 01, 2015
- 3885 views
I believe that system would have to be put back in place to properly display the content, unless you want to pluck out the content manually.
I'll pluck it out when I get a chance.
58. Re: Easy Euphoria a Fairy tale
- Posted by Spock Jun 01, 2015
- 3861 views
Unix is too much like going back to MS-DOS in terms of getting too close to the OS and even the hardware to have time to do a proper job designing the actual application requirement. IMHO.
...
Irv, just to clarify. Andy actually made that comment.
Spock
59. Re: Easy Euphoria a Fairy tale
- Posted by ChrisB (moderator) Jun 01, 2015
- 3828 views
Hi
I've just uploaded a sandpit (sandbox) for euphoria to the rapideuphoria atchive. Very simple, created with tinEWG plonkable IDE and editors. Allows you to type in code, fiddle with it and see the results in a console (will also run windows programs too, but with the console running). Allows you to browse to eu programs, load them in, fiddle with them. Allows you to copy and paste code in, and play with it, and see the result. Loads programs non destructively - ie do what you want with them, won't change the original program. Isn't a full editor, just a very quick and simple toy / teaching aid.
Run it, and load up Sandpit.exw to see how simple it is.
Most editors will do this too of course, but this really is click and go.
Chris
60. Re: Easy Euphoria a Fairy tale
- Posted by DerekParnell (admin) Jun 15, 2015
- 3547 views
By the way, this could have been written up in the Wiki using creole markup rather than HTML.
Anyhow ... here is a more generic (and nicer?) version of the final code
include std/console.e integer a = 3 integer b = 5 integer c = 100 for i = 1 to c do if remainder(i,a * b) = 0 then display("FizzBuzz") elsif remainder(i,a) = 0 then display("Fizz") elsif remainder(i,b) = 0 then display("Buzz") else display(i) end if end for
61. Re: Easy Euphoria a Fairy tale
- Posted by irv Jun 15, 2015
- 3518 views
By the way, this could have been written up in the Wiki using creole markup rather than HTML.
Anyhow ... here is a more generic (and nicer?) version of the final code
include std/console.e integer a = 3 integer b = 5 integer c = 100 for i = 1 to c do if remainder(i,a * b) = 0 then display("FizzBuzz") elsif remainder(i,a) = 0 then display("Fizz") elsif remainder(i,b) = 0 then display("Buzz") else display(i) end if end for
Don't know Creole.
You're right about the above code being more generic and nicer - but that wasn't my goal. I was trying to see Euphoria from the standpoint of someone who knew little or nothing about programming, except for perhaps some Basic from the days when dinosaurs ruled the earth.
Such a person would most likely try print - and finding it wouldn't work, would look that up in the docs. There's no reference to display there - just "see also" ? and puts. Below print he would find printf, with "see also" sprint and sprintf.
display, as a key word, could potentially have all sorts of meanings other than putting characters on the screen. Display an image? Set the terminal lines and characters? etc....
62. Re: Easy Euphoria a Fairy tale
- Posted by DerekParnell (admin) Jun 15, 2015
- 3499 views
Sorry. I should know better than to attempt assistance - nearly always misunderstood as an attack. Bye bye.
63. Re: Easy Euphoria a Fairy tale
- Posted by irv Jun 15, 2015
- 3500 views
Sorry. I should know better than to attempt assistance - nearly always misunderstood as an attack. Bye bye.
I didn't take your post as any kind of attack. I simply explained why I wrote the page as I did. It wasn't intended to be "the best" way to write a program.
I do think a beginning programmer might try something similar to the steps I used. That same beginner might not stumble across display for quite some time.
64. Re: Easy Euphoria a Fairy tale
- Posted by jimcbrown (admin) Jun 15, 2015
- 3489 views
I do think a beginning programmer might try something similar to the steps I used. That same beginner might not stumble across display for quite some time.
Agreed, but in a perfect world, they should, though. Perhaps we need a docs update?
65. Re: Easy Euphoria a Fairy tale
- Posted by jimcbrown (admin) Jun 15, 2015
- 3523 views
By the way, this could have been written up in the Wiki using creole markup rather than HTML.
That's a great idea. I don't see any reason why we can't replace that page with a wiki page. Certainly, it'd make future updates easier.
66. Re: Easy Euphoria a Fairy tale
- Posted by irv Jun 15, 2015
- 3503 views
I do think a beginning programmer might try something similar to the steps I used. That same beginner might not stumble across display for quite some time.
Agreed, but in a perfect world, they should, though. Perhaps we need a docs update?
That certainly wouldn't hurt. Perhaps I'm alone in this, but I usually can learn a lot more a lot faster by reading good source code than by studying a manual. Show me a small Python program, and I can usually convert it to Euphoria in a few minutes. Give me the specs and the Python manual, it might take a week.
Maybe other folks also look for example code. If they do, then there's a problem, since much of the code on RDS' site is very old Eu, written before the libraries were available and standardized. So they're not seeing the 'modern' way to do things. No use of switch/case, just line after line of if...elsif... No use of display, format, etc.
Short of having the authors bring their code up to date (which isn't going to happen), what's the solution?
67. Re: Easy Euphoria a Fairy tale
- Posted by _tom (admin) Jun 15, 2015
- 3452 views
By the way, this could have been written up in the Wiki using creole markup rather than HTML.
That's a great idea. I don't see any reason why we can't replace that page with a wiki page. Certainly, it'd make future updates easier.
Done. http://openeuphoria.org/wiki/view/fizzbuzz.wc
This is Irv Mullins' example converted to Creole. I have also added Derek Parnell's version as an appendix.
_tom
68. Re: Easy Euphoria a Fairy tale
- Posted by jmduro Jun 16, 2015
- 3424 views
Maybe other folks also look for example code. If they do, then there's a problem, since much of the code on RDS' site is very old Eu, written before the libraries were available and standardized. So they're not seeing the 'modern' way to do things. No use of switch/case, just line after line of if...elsif... No use of display, format, etc.
Maybe just simply sort contributions by most recent date when a search is done. That's a feature that is missing in this wonderful site.
69. Re: Easy Euphoria a Fairy tale
- Posted by ChrisB (moderator) Jun 16, 2015
- 3414 views
Hi
So can we add example code to the wiki? Would it be ok to add the hunt the wumpus program, for people to play with?
Chris
70. Re: Easy Euphoria a Fairy tale
- Posted by _tom (admin) Jun 16, 2015
- 3419 views
Hi
So can we add example code to the wiki? Would it be ok to add the hunt the wumpus program, for people to play with?
Chris
Yes, just enclose the source-code between <eucode> and </eucode> markers.
Anything Euphoria related is fair game.
_tom
71. Re: Easy Euphoria a Fairy tale
- Posted by irv Jun 16, 2015
- 3385 views
Looks good.
The only thing I would want is some way to differentiate between source code and program output. A beginner could get confused when they are mixed.
Is there a way to change the text/background color of a section ?
72. Re: Easy Euphoria a Fairy tale
- Posted by ghaberek (admin) Jun 16, 2015
- 3407 views
Looks good.
The only thing I would want is some way to differentiate between source code and program output. A beginner could get confused when they are mixed.
Is there a way to change the text/background color of a section ?
My thought was that <eucode> should probably have an optional header like the [quote] box.
So this...
<eucode myfile.e> </eucode>
Looks like this... (sort of)
myfile.e |
---|
-- eucode |
Also, why does <eucode> use less-than/greater-than (<>) but [quote] uses brackets ([])?
-Greg
73. Re: Easy Euphoria a Fairy tale
- Posted by _tom (admin) Jun 16, 2015
- 3395 views
Creole is a wiki markup that has been standardized ( see www.wikicreole.org). The standard is at version 1.0 and is considered to be stable and final; the logic and limits of this standard are described in the Creole website.
Derek Parnell created a native Euphoria engine that complies with the Creole standard--which is used in this forum and wiki. He added the <eucode> extension for our own use.
But, we are also using Creole for document publishing. For documentation markup we could create a long wishlist of what Creole could do.
Since Derek Parnell is the only person that understands the Creole engine, the question is "what kind of eye-candy can be added to the Creole engine without making Derek's life miserable?"
I would like to see inline SVG images added to the graphics tags. That should allow images to be viewed in a wiki or forum page without an external server.
So far, Creole has served us well, so thanks to Derek.
_tom