PDA

View Full Version : Euphoria



ErosOlmi
07-07-2007, 09:29
Recently I came across Euphoria programming language.

Web site at: http://www.rapideuphoria.com/

It is a script engine able to execute script files on the fly but it has also a translator to convert Euphoria scripts to C.
Anyhow, what impressed more to me was SPEED: FAST. The faster script engine I've ever seen. Not just 2/3/10 times faster than any other script engine: hundred of times.

I checked C sources and get some of the reasons why it is so fast but still looking at.
For those loving scripting and like to start in C programming, worth to have a look. Licence encourage derivative projects so perfect for personal or commercial projects.

Ciao
Eros

kryton9
07-07-2007, 09:54
Yeagh Euphoria is pretty amazing Eros. Not only fast, but if you look at the logic, really really neat and efficient.

John Spikowski
26-07-2008, 09:50
Kent,

They have done a great job with a win32api include and GUI designer and IDE. (user contributions)

There is a huge library of code as well. This seems to be a well connected group.

I ran the Sieve benchmark and nothing I compared Euphoria to even came close. (compiled to C binary)

I think this is a great way to develop applications you plan to link with existing C libraries.

It's funny you don't hear much about Euphoria but it's been around for awhile.

John

kryton9
26-07-2008, 10:20
I really have no understanding why it hasn't broken into the mainstream. I always thought it would, but it has been out for some time now as you mentioned, so it is a mystery.

John Spikowski
26-07-2008, 10:27
This might be a way for thinBasic to go multi-platform.

I wonder how much work it would be to port the core thinBasic engine to Euphoria and compile to C for Windows, Linux and FreeBSD versions of thinBasic.

jcfuller
26-07-2008, 13:23
I really have no understanding why it hasn't broken into the mainstream. I always thought it would, but it has been out for some time now as you mentioned, so it is a mystery.


kent,

The first example I looked at was a bit daunting. Yes; they say to use Win32Lib but that does not make it very portable to Linux. It appears the only gui portability is obtained through wx.... -> WxWidgets I presume?

James



-- A Standard Windows Window coded at the primitive API level
-- Most Euphoria programmers should simply use Win32Lib!

include misc.e
include machine.e
include dll.e

constant cbSize = 0,
style = 4,
lpfnWndProc = 8,
cbClsExtra = 12,
cbWndExtra = 16,
hInstance = 20,
hIcon = 24,
hCursor = 28,
hbrBackground = 32,
lpszMenuName = 36,
lpszClassName = 40,
hIconSm = 44,
SIZE_OF_WNDCLASS = 48

constant SIZE_OF_MESSAGE = 40

constant CS_HREDRAW = 2,
CS_VREDRAW = 1

constant SW_SHOWNORMAL = 1

constant WM_CREATE = #01,
WM_PAINT = #0F,
WM_DESTROY= #02

constant SND_FILENAME = #00020000,
SND_ASYNC = #00000001

constant DT_SINGLELINE = #0020,
DT_CENTER = #0001,
DT_VCENTER = #0004

function or_all(sequence s)
-- or together all elements of a sequence
atom result

result = 0
for i = 1 to length(s) do
result = or_bits(result, s[i])
end for
return result
end function

constant WS_OVERLAPPED = #00000000,
WS_CAPTION = #00C00000,
WS_SYSMENU = #00080000,
WS_THICKFRAME = #00040000,
WS_MINIMIZEBOX = #00020000,
WS_MAXIMIZEBOX = #00010000

constant IDC_ARROW = 32512,
WHITE_BRUSH = 0,
CW_USEDEFAULT = #80000000,
WS_OVERLAPPEDWINDOW = or_all({WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU,
WS_THICKFRAME, WS_MINIMIZEBOX,
WS_MAXIMIZEBOX})


integer LoadIcon, LoadCursor, GetStockObject, RegisterClassEx,
CreateWindow, ShowWindow, UpdateWindow, GetMessage,
TranslateMessage, DispatchMessage, PlaySound, BeginPaint,
GetClientRect, DrawText, EndPaint, PostQuitMessage, DefWindowProc

procedure not_found(sequence name)
puts(1, "Couldn't find " & name & '\n')
abort(1)
end procedure

function link_c_func(atom dll, sequence name, sequence args, atom result)
-- dynamically link a C routine as a Euphoria function
integer handle

handle = define_c_func(dll, name, args, result)
if handle = -1 then
not_found(name)
else
return handle
end if
end function

function link_c_proc(atom dll, sequence name, sequence args)
-- dynamically link a C routine as a Euphoria function
integer handle

handle = define_c_proc(dll, name, args)
if handle = -1 then
not_found(name)
else
return handle
end if
end function

procedure link_dll_routines()
-- get handles to all dll routines that we need
atom user32, gdi32, winmm

user32 = open_dll("user32.dll")
if user32 = NULL then
not_found("user32.dll")
end if
gdi32 = open_dll("gdi32.dll")
if gdi32 = NULL then
not_found("gdi32.dll")
end if
winmm = open_dll("winmm.dll")
if winmm = NULL then
not_found("winmm.dll")
end if

LoadIcon = link_c_func(user32, "LoadIconA", {C_POINTER, C_INT}, C_INT)
LoadCursor = link_c_func(user32, "LoadCursorA", {C_POINTER, C_INT}, C_INT)
GetStockObject = link_c_func(gdi32, "GetStockObject", {C_INT}, C_INT)
RegisterClassEx = link_c_func(user32, "RegisterClassExA", {C_POINTER}, C_INT)
CreateWindow = link_c_func(user32, "CreateWindowExA",
{C_INT, C_INT,C_INT,C_INT,C_INT,C_INT,C_INT,C_INT,C_INT,C_INT,C_INT,C_INT},
C_INT)
ShowWindow = link_c_proc(user32, "ShowWindow", {C_INT, C_INT})
UpdateWindow = link_c_proc(user32, "UpdateWindow", {C_INT})
GetMessage = link_c_func(user32, "GetMessageA",
{C_INT, C_INT, C_INT, C_INT}, C_INT)
TranslateMessage = link_c_proc(user32, "TranslateMessage", {C_INT})
DispatchMessage = link_c_proc(user32, "DispatchMessageA", {C_INT})
PlaySound = link_c_proc(winmm, "PlaySound", {C_INT, C_INT, C_INT})
BeginPaint = link_c_func(user32, "BeginPaint", {C_INT, C_POINTER}, C_INT)
GetClientRect = link_c_proc(user32, "GetClientRect", {C_INT, C_POINTER})
DrawText = link_c_proc(user32, "DrawTextA",
{C_INT, C_INT, C_INT, C_INT, C_INT})
EndPaint = link_c_proc(user32, "EndPaint", {C_INT, C_INT})
PostQuitMessage = link_c_proc(user32, "PostQuitMessage", {C_INT})
DefWindowProc = link_c_func(user32, "DefWindowProcA",
{C_INT, C_INT, C_INT, C_INT}, C_INT)
end procedure

link_dll_routines()

atom wav_file, Euphoria, ps, rect
wav_file = allocate_string("\\Windows\\Media\\tada.wav")
Euphoria = allocate_string("A Plain Vanilla Window using Euphoria!")
ps = allocate(64)
rect = allocate(16)

global function WndProc(atom hwnd, atom iMsg, atom wParam, atom lParam)
-- callback routine to handle Window class
atom hdc
integer temp

if iMsg = WM_CREATE then
c_proc(PlaySound, {wav_file,
NULL,
or_bits(SND_FILENAME, SND_ASYNC)})
return 0

elsif iMsg = WM_PAINT then
hdc = c_func(BeginPaint, {hwnd, ps})
c_proc(GetClientRect, {hwnd, rect})
c_proc(DrawText, {hdc, Euphoria, -1, rect,
or_all({DT_SINGLELINE, DT_CENTER, DT_VCENTER})})
c_proc(EndPaint, {hwnd, ps})
return 0

elsif iMsg = WM_DESTROY then
c_proc(PostQuitMessage, {0})
return 0

end if

temp = c_func(DefWindowProc, {hwnd, iMsg, wParam, lParam})
return temp
end function

atom my_title
my_title = allocate_string("Euphoria for WIN32")

procedure WinMain()
-- main routine
atom szAppName
atom hwnd
atom msg
atom wndclass
atom WndProcAddress
atom class
integer id
atom icon_handle

wndclass = allocate(SIZE_OF_WNDCLASS)
msg = allocate(SIZE_OF_MESSAGE)
szAppName = allocate_string("HelloWin")

id = routine_id("WndProc")
if id = -1 then
puts(1, "routine_id failed!\n")
abort(1)
end if
WndProcAddress = call_back(id) -- get 32-bit address for callback

poke4(wndclass + cbSize, SIZE_OF_WNDCLASS)
poke4(wndclass + style, or_bits(CS_HREDRAW, CS_VREDRAW))
poke4(wndclass + lpfnWndProc, WndProcAddress)
poke4(wndclass + cbClsExtra, 0)
poke4(wndclass + cbWndExtra, 0)
poke4(wndclass + hInstance, 0) --hInstance

-- set icon in top-left of window
icon_handle = c_func(LoadIcon, {instance(), allocate_string("exw")})
poke4(wndclass + hIcon, icon_handle)
poke4(wndclass + hIconSm, icon_handle)

-- Wolfgang Fritz observes that you can set an icon
-- dynamically using:
-- junk = sendMessage(YourWindow, 128, 1, icon_handle)
-- where 128 is WM_SETICON

poke4(wndclass + hCursor, c_func(LoadCursor, {NULL, IDC_ARROW}))
poke4(wndclass + hbrBackground, c_func(GetStockObject, {WHITE_BRUSH}))
poke4(wndclass + lpszMenuName, NULL)
poke4(wndclass + lpszClassName, szAppName)

class = c_func(RegisterClassEx, {wndclass})
if class = 0 then
puts(1, "Couldn't register class\n")
abort(1)
end if
hwnd = c_func(CreateWindow, {
0, -- extended style
szAppName, -- window class name
my_title, -- window caption
WS_OVERLAPPEDWINDOW, -- window style
CW_USEDEFAULT, -- initial x position
CW_USEDEFAULT, -- initial y position
CW_USEDEFAULT, -- initial x size
CW_USEDEFAULT, -- initial y size
NULL, -- parent window handle
NULL, -- window menu handle
0 , --hInstance // program instance handle
NULL}) -- creation parameters
if hwnd = 0 then
puts(1, "Couldn't CreateWindow\n")
abort(1)
end if
c_proc(ShowWindow, {hwnd, SW_SHOWNORMAL})
c_proc(UpdateWindow, {hwnd})

while c_func(GetMessage, {msg, NULL, 0, 0}) do
c_proc(TranslateMessage, {msg})
c_proc(DispatchMessage, {msg})
end while
end procedure

WinMain()

John Spikowski
26-07-2008, 21:41
Hi James,

Nice to see you here as well.

Since thinBasic is an interpreter, the GUI should be a module that user selects with a meta statement. If you running under Windows then it defaults to win32api but a GTK or wxWidget or ... could be used.

I'm just getting up to speed with thinBasic but I like the modular direction. It reminds me of ScriptBasic in a way with it's tightly integrated extension modules.

I'm interested what the thinBasic authors are thinking when it comes running the interpreter on platforms other then Windows.


John

kryton9
26-07-2008, 21:43
jcfuller, well winapi coding looks daunting it seems in any language, because of the way it was coded back then it seems :)

There is a page where they explain why it is easier and better than c++, that should shed light on its capabilities.
I just tinkered with euphoria from time to time and never on linux, so I can't respond to your questions about the gui, sorry.

I am researching wxWidgets compared to Qt now. Qt seems to have a buzz about it going on now and I am trying to understand why.

kryton9
26-07-2008, 21:50
I posted at the same time John did it seems :)

I think I have given Eros a headache all the times I bothered him with moving to another core for thinBasic to open it up to all the future devices and environments coming.
I am sure he is researching it and evaluating it, but as he mentioned many times, he wants a dependable core language as powerbasic's compiler has proven to be.

I do like how multi-line is handled in Euphoria, maybe Eros can make it so in thinBasic.

Instead of current _ as continuation for multi-line
to use , at the end of the line as in Euphoria.

John Spikowski
26-07-2008, 21:52
Kent,

QT is a very nice GUI toolkit and free for non commercial use. (unlike GTK and a few other GUI toolkits that can be used in commercial applications) Check out Gambas as that is what they use as a default but also supports GTK. (not fully implemented)

Can you tell me how many active thinBasic language developers (authors) there are? Will thinBasic become open source at some point?


John

John Spikowski
26-07-2008, 22:51
James,

Here is your example converted to C. The file exceeded 200,000 bytes and couldn't be posted here as CODE.

http://www.scriptbasic.org/TB/ewin.c.txt

The resulting .exe was 132K.

John

ErosOlmi
27-07-2008, 00:00
Can you tell me how many active thinBasic language developers (authors) there are? Will thinBasic become open source at some point?

For this specific aspect, continue at: http://community.thinbasic.com/index.php?topic=1911.msg14129#msg14129

Please remain on subject for the rest of this thread.

Regards
Eros

John Spikowski
27-07-2008, 02:54
I thought I would take the simple Euphoria window demo one step further. I downloaded the win32 zip which included a bunch of demos. One of the samples was a simple window like what James was showing us but using the win32 library.

http://www.scriptbasic.org/TB/window.png

Euphoria Source


include Win32Lib.ew

global constant TheForm = createEx(Window,"This is TheForm", 0,
Default,Default,
318,238,
{WS_CLIPCHILDREN,WS_CAPTION,WS_SYSMENU},
{WS_EX_STATICEDGE}

)


WinMain(TheForm,Normal)


Compile to C


C:\EUPHORIA\DEMO>ecw ewin2.exw

52 .c files were created.
To build your .exe file, type: emake

C:\EUPHORIA\DEMO>emake
compiling with BORLAND
ewin2.c:
main-.c:
main-0.c:
main-1.c:
main-2.c:
main-3.c:
main-4.c:
main-5.c:
Win32Lib.c:
Win32L_0.c:
Win32L_1.c:
Win32L_2.c:
Win32L_3.c:
Win32L_4.c:
Win32L_5.c:
Win32L_6.c:
Win32L_7.c:
Win32L_8.c:
Win32L_9.c:
Win32L_A.c:
Win32L_B.c:
Win32L_C.c:
Win32L_D.c:
Win32L_E.c:
Win32L_F.c:
machine.c:
dll.c:
msgbox.c:
misc.c:
file.c:
sort.c:
get.c:
wildcard.c:
w32msgs.c:
w32utils.c:
w32uti_0.c:
w32memory.c:
w32mem_0y.c:
w32mem_1y.c:
w32mem_2y.c:
w32mem_3y.c:
w32mem_4y.c:
series.c:
w32constants.c:
w32dll.c:
w32file.c:
w32resources.c:
w32res_0rces.c:
w32res_1rces.c:
w32xpm.c:
w32forms.c:
init-.c:
you can now execute: ewin2.exe

C:\EUPHORIA\DEMO>


After all that ...

07/26/2008 05:49 PM 1,100,800 ewin2.exe

And I thought Microsoft was the bloat master.


John

John Spikowski
27-07-2008, 05:26
I installed the IDE / Designer for Euphoria and thought I would post a screen shot.

http://www.scriptbasic.org/TB/eide.png

http://www.scriptbasic.org/TB/eedit.png

http://www.scriptbasic.org/TB/estyle.png

http://www.scriptbasic.org/TB/epref.png


Euphoria IDE Source (http://www.scriptbasic.org/TB/IDE.code.txt)

IDE compiled to C



C:\EUPHORIA>ecw IDE.exw

223 .c files were created.
To build your .exe file, type: emake

C:\EUPHORIA>emake
compiling with BORLAND
IDE.c:
main-.c:
main-0.c:
main-1.c:
main-2.c:
main-3.c:
main-4.c:
main-5.c:
main-6.c:
main-7.c:
main-8.c:
main-9.c:
main-10.c:
main-11.c:
main-12.c:
main-13.c:
main-14.c:
main-15.c:
main-16.c:
main-17.c:
main-18.c:
main-19.c:
main-20.c:
main-21.c:
main-22.c:
IDE_0.c:
IDE_1.c:
IDE_2.c:
IDE_3.c:
IDE_4.c:
IDE_5.c:
IDE_6.c:
IDE_7.c:
IDE_8.c:
IDE_9.c:
IDE_A.c:
IDE_B.c:
IDE_C.c:
IDE_D.c:
IDE_E.c:
IDE_F.c:
IDE_G.c:
IDE_H.c:
IDE_I.c:
IDE_J.c:
IDE_K.c:
IDE_L.c:
IDE_M.c:
IDE_N.c:
IDE_O.c:
IDE_P.c:
IDE_Q.c:
IDE_R.c:
IDE_S.c:
IDE_T.c:
IDE_U.c:
IDE_V.c:
IDE_W.c:
win32lib.c:
win32l_0.c:
win32l_1.c:
win32l_2.c:
win32l_3.c:
win32l_4.c:
win32l_5.c:
win32l_6.c:
win32l_7.c:
win32l_8.c:
win32l_9.c:
win32l_A.c:
win32l_B.c:
win32l_C.c:
win32l_D.c:
win32l_E.c:
win32l_F.c:
win32l_G.c:
win32l_H.c:
win32l_I.c:
win32l_J.c:
machine.c:
dll.c:
msgbox.c:
misc.c:
file.c:
sort.c:
get.c:
wildcard.c:
w32msgs.c:
w32utils.c:
w32uti_0.c:
w32memory.c:
w32mem_0y.c:
w32mem_1y.c:
w32mem_2y.c:
w32mem_3y.c:
w32mem_4y.c:
series.c:
w32constants.c:
w32dll.c:
w32Kernel.c:
w32file.c:
w32resources.c:
w32res_0rces.c:
w32res_1rces.c:
w32res_2rces.c:
w32xpm.c:
w32forms.c:
w32tk.c:
IDE_splash.c:
ruler.c:
IDE_docking.c:
alphablend.c:
ide_projectview.c:
ide_pr_0ectview.c:
IDE_about.c:
ide_config.c:
ide_co_0ig.c:
ide_draw.c:
ide_dr_0.c:
ide_findwin.c:
ide_code.c:
ide_co_0.c:
ide_co_1.c:
ide_co_2.c:
ide_co_3.c:
ide_co_4.c:
ide_co_5.c:
ide_co_6.c:
ide_co_7.c:
ide_co_8.c:
ide_syntax.c:
ide_sy_0ax.c:
ide_sy_1ax.c:
ide_sy_2ax.c:
ide_sy_3ax.c:
ide_sy_4ax.c:
ide_sy_5ax.c:
ide_sy_6ax.c:
nlsEU.c:
Print.c:
printOptions.c:
PrtRoutines.c:
tabbedpalette.c:
FList.c:
FList_0.c:
ide_orderEvents.c:
ide_exErr.c:
ide_proj.c:
ide_pr_0.c:
ide_pr_1.c:
ide_pr_2.c:
ide_pr_3.c:
ide_pr_4.c:
ide_pr_5.c:
ide_pr_6.c:
ide_pr_7.c:
ide_pr_8.c:
ide_pr_9.c:
ide_pr_A.c:
ide_pr_B.c:
ide_pr_C.c:
ide_pr_D.c:
ide_pr_E.c:
ide_menu.c:
ide_me_0.c:
ide_me_1.c:
ide_me_2.c:
ide_popup.c:
ide_po_0p.c:
ide_po_1p.c:
ide_po_2p.c:
ide_timer.c:
ide_ti_0r.c:
ide_ti_1r.c:
ide_design.c:
ide_de_0gn.c:
ide_de_1gn.c:
ide_de_2gn.c:
ide_de_3gn.c:
ide_de_4gn.c:
ide_de_5gn.c:
ide_de_6gn.c:
ide_de_7gn.c:
ide_de_8gn.c:
ide_de_9gn.c:
ide_de_Agn.c:
ide_de_Bgn.c:
ide_de_Cgn.c:
ide_de_Dgn.c:
ide_de_Egn.c:
ide_de_Fgn.c:
ide_de_Ggn.c:
ide_de_Hgn.c:
ide_de_Ign.c:
ide_reorder.c:
ide_include.c:
ide_in_0ude.c:
ide_initlist.c:
ide_mbox.c:
ide_launch.c:
ide_systray.c:
ide_ListViewStyles.c:
ide_Li_0ViewStyles.c:
ide_Li_1ViewStyles.c:
ide_Li_2ViewStyles.c:
ide_Li_3ViewStyles.c:
ide_Li_4ViewStyles.c:
IDE_scrollingTable.c:
ide_xpmmer.c:
ide_xp_0er.c:
ide_xp_1er.c:
ide_xp_2er.c:
prop.c:
prop_0.c:
prop_1.c:
viewCodeBase.c:
ide_winstyles.c:
ide_wi_0tyles.c:
process.c:
init-.c:
init-0.c:
init-1.c:
init-2.c:
you can now execute: IDE.exe

C:\EUPHORIA>dir ide.exe

07/27/2008 03:23 AM 6,873,088 IDE.exe



Summary:

As Eros commented in creating this thread, Euphoria is a blazing fast interpreter. I'm sure there is a way to reduce the .exe size with including only what you need before converting to C. I'm looking at Euphoria for it's CGI possibilities. If I can generate small/fast CGI programs for Linux then it may be worth learning the ins and outs of Euphoria and take a step further.

James, Eros and Kent,

I would be interested in what you guys think about Euphoria and is it a viable development tool? With all the source codes examples available on their site, somebody must think so.

John

kryton9
28-07-2008, 03:46
Thanks for the screenshots.

About the exe, I know in freepascal the exe's are big, but there is a utility called strip, that takes the big exe and makes it nice and small. They you can make it even smaller with upx.

I don't know if euphoria has that in their release, will need to check.

Since I am interested in 3d stuff, I am testing Java this week and will test Euphoria next week to see where it is at.
Hopefully can comment more then.

John Spikowski
28-07-2008, 04:44
Kent,

Thanks for the reply. I'll let you know how my CGI Euphoria to C scripts turn out and how large they are when the win32api isn't a factor.


John

jack
28-07-2008, 05:16
I used Euphoria many years ago in the DOS days, this thread led me to take another look.
browsed their file Archive and found that someone had compiled Euphoria as a dll, unfortunately it only
gives a very simple example, it would be interesting to use the dll as a script engine.

John Spikowski
28-07-2008, 05:38
Jack,

I have seen all kinds a cool examples including COM. Seems to be something for everyone on the Euphoria site.

I assume your looking for a embeddable scripting solution for a compiled application you have, correct?

You might want to have a look at ScriptBasic (http://www.scriptBasic.org) as it's embeddable and is written in ANSI C so it compiles on a wide verity of platforms. I know of a router company that uses ScriptBasic embedded in their products.

John

kryton9
28-07-2008, 08:06
John, thinBasic can be run from servers to be the scripting language on a server. Eros can fill you in more.
There is a test site to show it in action... will try to find it for you.

Here is the thread about it, the server seems to be not working at the moment.
http://community.thinbasic.com/index.php?topic=225.0

John Spikowski
28-07-2008, 08:48
Kent,

My dedicated server at a data center is running CentOS (Linux Red Hat).

ScriptBasic multi-threaded HTTPD server with in memory session support works great as a CGI application server.

I'm looking at Euphoria as a way to do C programming in a Basic like setting. Linking in other C libraries is where this is going to shine.

John

Petr Schreiber
28-07-2008, 09:11
Kent,

the server is http://cgi.thinbasic.com/ now.
But if John needs to run it on Linux server, I think it would not work for him ( maybe using Wine, but that is a bit unusual ).


Petr

John Spikowski
28-07-2008, 10:27
Hi Petr,

I'm starting to use thinBasic as a Windows utility Basic. It's like a handy power tool with a drawer full of attachments. ;)

I would never use Windows for something as critical as hosting web sites. It's fine for desktops that don't put a lot of stress on it's multi-tasking capabilities.

Open source is another requirement I have migrated to over the years and is my first choice before looking at proprietary solutions.

Here is a ScriptBasic CGI Demo (http://www.scriptbasic.org/forum/index.php/topic,2.0.html).

Back to the Euphoria topic ...

John

achury
28-07-2008, 22:15
I used Euphoria many years ago in the DOS days, this thread led me to take another look.
browsed their file Archive and found that someone had compiled Euphoria as a dll, unfortunately it only
gives a very simple example, it would be interesting to use the dll as a script engine.


I'm Euphoria user. My comments:

Is factible to write your BASIC interpreter on Euphoria to make it more portable. The current euphoria installation includes an Euphoria interpreter 100% writed on Euphoria. This runs with acceptable speed running from source and is better after compiled. On the Euphoria archive there are some interpreters and assemblers writed on euphoria. There is a database aplication on the archive that use the "Eu on Eu" interpreter as script machine to interprete user commands. So you can write your interpreter on Euphoria using generic code non platform-dependent and compile it to get an stand-alone binary, no libraries or run time required to distribute your file.

The Euphoria as DLL is by now just a toy more than a production tool. May be in the future... You can call the functions but sometimes you must to pass to the functions pointer to your data with Euphoria internal formats.

Euphoria was for so many years a commercial shareware app, developed since 1993 by Robert Craig and Junko Miura (his wife), is a great concept but he alone arrived a point where the language was not profitable and he was not able to support the exigences of the growing community. Now is free and open source, with more people working on it, the working for Euphoria 4.0 is very active and I we must to have a beta version in next few months. So many things may change. The current pre-alpha runs on Mac OSX so will be more platforms: DOS32, WIN32, LINUX, FREEBSD and OSX.

About GUI there is not an standar, the Euphoria interpreter simply calls the OS, you can use some libraries to simplify the work. Win32lib is not portable, you can write platform specific code, or check WxEuphoria and IUP. Both are cross platform and have been used on Euphoria.

About my experience with the language, is great, one of the best thing he has is the users community have grow around. The Archive has about 1800 example programs, the more of them with source code and the main GUI libraries and the IDE have been developed by users.

You are welcome to interchange ideas at IRC:
irc.freenode.net
#Euphoria

Marco Achury
Caracas, Venezuela

achury
28-07-2008, 23:17
Recently I came across Euphoria programming language.

Web site at: http://www.rapideuphoria.com/

It is a script engine able to execute script files on the fly but it has also a translator to convert Euphoria scripts to C.
Anyhow, what impressed more to me was SPEED: FAST. The faster script engine I've ever seen. Not just 2/3/10 times faster than any other script engine: hundred of times.

I checked C sources and get some of the reasons why it is so fast but still looking at.
For those loving scripting and like to start in C programming, worth to have a look. Licence encourage derivative projects so perfect for personal or commercial projects.

Ciao
Eros




I'm Euphoria user. My comments:

Is factible to write your BASIC interpreter on Euphoria to make it more portable. The current euphoria installation includes an Euphoria interpreter 100% writed on Euphoria. This runs with acceptable speed running from source and is better after compiled. On the Euphoria archive there are some interpreters and assemblers writed on euphoria. There is a database aplication on the archive that use the "Eu on Eu" interpreter as script machine to interprete user commands. So you can write your interpreter on Euphoria using generic code non platform-dependent and compile it to get an stand-alone binary, no libraries or run time required to distribute your file.

The Euphoria as DLL is by now just a toy more than a production tool. May be in the future... You can call the functions but sometimes you must to pass to the functions pointer to your data with Euphoria internal formats.

Euphoria was for so many years a commercial shareware app, developed since 1993 by Robert Craig and Junko Miura (his wife), is a great concept but he alone arrived a point where the language was not profitable and he was not able to support the exigences of the growing community. Now is free and open source, with more people working on it, the working for Euphoria 4.0 is very active and I we must to have a beta version in next few months. So many things may change. The current pre-alpha runs on Mac OSX so will be more platforms: DOS32, WIN32, LINUX, FREEBSD and OSX.

About GUI there is not an standar, the Euphoria interpreter simply calls the OS, you can use some libraries to simplify the work. Win32lib is not portable, you can write platform specific code, or check WxEuphoria and IUP. Both are cross platform and have been used on Euphoria.

About my experience with the language, is great, one of the best thing he has is the users community have grow around. The Archive has about 1800 example programs, the more of them with source code and the main GUI libraries and the IDE have been developed by users.

You are welcome to interchange ideas at IRC:
irc.freenode.net
#Euphoria

Marco Achury
Caracas, Venezuela

Petr Schreiber
28-07-2008, 23:33
Hi Achury,

thanks for your info and opinions!
Euphoria really looks interesting, it is not first time I hear about it.

Which applications do you write using it?


Thanks,
Petr

P.S. When you want to change something in your post, you can click "modify message" in top right corner of your post. Then you can freely do changes you need. I originally tried to find 10 differences between your first and second post without much success except quote :).

ErosOlmi
28-07-2008, 23:54
Is factible to write your BASIC interpreter on Euphoria to make it more portable.


Hi achury, welcome here.

If you are referring to thinBasic, I do not think it is a possible task.
Just thinBasic Core engine is now a more than 170000 source code project. Considering all developed modules I suppose we can go at more than 250000 lines of source code. Considering also the unique features the compiler we are using (PowerBasic) give us, it would be a no go road.

But I follow always with great interest Euphoria project. I red some of the core engine source code to get inspirations for some problems I faced in the past looking at how others have solved them.

Ciao
Eros

achury
29-07-2008, 04:31
Hi Achury,

thanks for your info and opinions!
Euphoria really looks interesting, it is not first time I hear about it.

Which applications do you write using it?



- Mainly CGI, including, also note that all the site www.openeuphoria.org, with wiki and forum runs on euphoria CGI scripts.

- Some DOS programs to generate graphics and fractals. I'm to lazy to port them to windows, but some months ago appear a library that wrap all DOS graphic functions to windows API so I plan to port them soon.

- A lot of small scripting for automate daily work, process text files and math operations.

- A small Norton Commander clone, wich was originally for DOS but I'm fixing to become cross-platform.

zlatkoAB
24-08-2008, 21:54
Hi achury...
I dont know that is Euphoria such a powerful language ???
So where i can find this archive with source?

ErosOlmi
24-08-2008, 21:56
In the first post of this thread there is the link to the official Euphoria web site.