Wirbel - a new programming language

Stuff that has yet to be sorted into a category.
Message
Author
reckrhodes
Posts: 116
Joined: Wed 30 May 2007, 08:15

Wirbel - a new programming language

#1 Post by reckrhodes »

As sir Barry Kauler says:

http://www.puppylinux.com/blog/?viewDetailed=00469

I compiled the source package into a pet.

First attachment was compiled using Puppy Linux 4.00
Second attachment was compiled using Puppy Linux 4.10
Last edited by reckrhodes on Sun 02 Nov 2008, 20:30, edited 2 times in total.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#2 Post by Lobster »

reckrhodes you are a star :)

How exciting.
The programmer of Wirbel is as smart as they get.

The documentation (3 tutorials) is already sounding like gibberish.
However that is because smart people don't slow down for the rest of us.

A new language.
Right at its inception - woof woof

did not seem to work for me

Code: Select all

# wirbel hello.w
Warning: No baustones index found. Continuing without any baustones.
Fatal:  in hello.w:1:
No variable or function with name 'print'
Error while compiling hello.w -> hello.
anyone have better luck?
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

reckrhodes
Posts: 116
Joined: Wed 30 May 2007, 08:15

#3 Post by reckrhodes »

thank you sir Lobster. :D

I was able to duplicate the error you posted.

Its my fault. The first pet i did attached was compiled using the puppy linux 4.1 of MU.

I edited my first post. It has two wirbel pets, for-4.1 and for-4.0.

I hope these will help.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#4 Post by Lobster »

Thank you reckrhodes Sir,

I removed the old version using the package manager
and got the following:

Code: Select all

There was an error expanding package wirbel-0.1.8-i386-for-4.1.tar.gz.
Either the file is corrupted, or has not expanded into its own directory with
name of wirbel-0.1.8-i386-for-4.1/ (which is how most packages expand).
You will have to go into /root/.packages/ directory and manually clean it up.

This script will now exit...
tried cleaning up the files too - still can not install . . .
Anyone else have better luck?
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#5 Post by Keef »

I got the same result as Lobster. Did a manual install of the files in the packages directory, but then got this again:

Code: Select all

# wirbel hello.w
Warning: No baustones index found. Continuing without any baustones.
Fatal:  in hello.w:1:
No variable or function with name 'print'
Error while compiling hello.w -> hello.
Perhaps I should be relieved not to have any baustones. Sounds painful.

Firefox
Posts: 172
Joined: Fri 03 Nov 2006, 12:38
Location: UK

wirbel install

#6 Post by Firefox »

Running pup 4.1 full harddrive install.
I simply followed the instructions on the wirbel site!
You will need your devx file to compile it.
Downloaded the wirbel tar.gz file and did a tar xzf wirbel.0.1.8.tar.gz. Then did a make then a make install and it works fine from the command line.
The baustones are in usr/local/lib/wirbel.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#7 Post by seaside »

Keef wrote:I got the same result as Lobster. Did a manual install of the files in the packages directory, but then got this again:

Code: Select all

# wirbel hello.w
Warning: No baustones index found. Continuing without any baustones.
Fatal:  in hello.w:1:
No variable or function with name 'print'
Error while compiling hello.w -> hello.
Perhaps I should be relieved not to have any baustones. Sounds painful.
I'm getting the same error, no matter how the directories are structured. Is it just me or does someone have the pet working (other than compiling from scratch)?

I feel close to passing a few baustones myself at this point....

Cur Dog
Posts: 64
Joined: Sun 23 Dec 2007, 00:49

#8 Post by Cur Dog »

Lobster, I to had the same error as you but I renamed the folder "wirbel-0.1.8-i386" in /root/.packages/ to "wirbel-0.1.8-i386-for-4.1" (without the " " ) and then installed the .pet.

After creating the hello file I attempted to execute and now I am getting this error

Code: Select all

# wirbel hello.w
wirbel: /usr/lib/libstdc++.so.6: no version information available (required by wirbel)
wic: /usr/lib/libstdc++.so.6: no version information available (required by wic)
wic: /usr/lib/libstdc++.so.6: no version information available (required by wic)
hello.w:2: Error:  syntax error, unexpected TOK_UNINDENT, expecting TOK_LINEEND
Parse error.
Error while compiling hello.w -> hello.
Has anyone had this problem?

reckrhodes
Posts: 116
Joined: Wed 30 May 2007, 08:15

error in compiling

#9 Post by reckrhodes »

Again its my fault. I compiled the source into pet even if it has a "wrapper error" when i untarred the source.

I recompiled the new downloaded source into pet this time. Tested the simple "hello.w" by using the command:

wic hello.w then ./hello it displays hello world.

hopefully this will work now.

this my hello.w simple program

print("hello world.")

note:
1. devx_400.sfs should be loaded first
2. please press enter after the close parenthesis so that the program above will work

Please use this pet I attached not the one above.

Cur Dog
Posts: 64
Joined: Sun 23 Dec 2007, 00:49

#10 Post by Cur Dog »

Thanks, reckrhodes....
note:
1. devx_400.sfs should be loaded first
2. please press enter after the close parenthesis so that the program above will work
# 2 seemed to have been my problem.....

Thanks again,

Cur Dog

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#11 Post by Keef »

I compiled from source too, and got success - apart from the forgot-to-hit-the-enter-key-so-smack-me-with-a-wet-fish error reported above. :oops:

brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

#12 Post by brad_chuck »

test_w.w

Code: Select all

#!/usr/bin/wirbel
print("test")
test_c.c

Code: Select all

#include <stdio.h>

  main()
  {
     printf ("test \n");
     return 0;
  }
test_b.sh

Code: Select all

#!/bin/sh
echo test
test_w => 68k
test_c => 8k
test_b.sh => 4k

64k of overheat is going to add up quick.

Is there something I am missing here?

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#13 Post by Lobster »

Thanks guys - got it working now :)
64k of overheat is going to add up quick.
It is a new language and optimisation may come later or may not be possible (because of the nature of the language)

Find out - write to the author
mk -at- mathias-kettner.de
I wrote to him to make him aware of this thread.
Where is Barry?
Has anyone converted any Python - used UPX on that 64k file?

Anyone know a simple python program that can be converted
and used in Puppy?
Remember with Wirbel we can create self running code - no python libraries needed - m m m . . .

;)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
MathiasKettner
Posts: 3
Joined: Sun 09 Nov 2008, 10:59
Contact:

Hello and size of executable

#14 Post by MathiasKettner »

Hello to you all,

first I want to thank you for your interest in Wirbel and to apologize for the
unconveniances Wirbel still has. Of couse the lack of documentation and
many other things is a great drawback. Also I've to apologize for my often
weird an incorrect English, I try my best ;-)

Now to your topics:

Code size: per default the output files are not stripped. If you strip them
with 'strip hello', the code size of the hello wolrd program for example
will go down from 69206 to 22648. In the current version 0.1.10 this
is done automatically if you call wic with the option -O (which also does
optimization).

Improvement: It will probably possible to further reduce the size of the
hello world program. But it will never be as small as a hand crafted C
program. It has - for example - to carry code for dynamic string handling,
even if you only print "hello world.". String handling is *very* inconveniant
in C. Every higher level language has some sort of dynamic strings at
the price of bigger code - may it be in some library or included in the executable
itself. If the size of the executable matters a lot in your environment, one
might think of putting as much as possible into a dynamic library that can be used
by all Wirbel programs. Currently Wirbel uses the static-library approach, because
that has the advantage that Wirbel executables run independent of *any*
component of Wirbel.

Greetings,

Mathias

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#15 Post by Lobster »

Hi Mathias

Welcome to the kennels (Puppy Community)
Glad you accepted my invitation - good to have you here :)

- just want to add something for Cur Dog
Your error messages (I got them in geany too) are caused by Linefeeds

- my solution from terminal type leafpad (another editor)
and paste text and save without linefeeds use CR (carriage return) instead - you can probably do this in Geany too . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#16 Post by Lobster »

Mathias your programming language is rejecting me :?

Code: Select all

# wirbel t2.w
input buffer overflow, can't enlarge buffer because scanner uses REJECT
Error while compiling t2.w -> t2.
# 
What did i do to it?

code (converting from python) enclosed
Attachments
t2.tar.gz
(3.14 KiB) Downloaded 367 times
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
MathiasKettner
Posts: 3
Joined: Sun 09 Nov 2008, 10:59
Contact:

#17 Post by MathiasKettner »

Lobster wrote: - just want to add something for Cur Dog
Your error messages (I got them in geany too) are caused by Linefeeds
Wirbel does currently not like it if there is no line feed at the end of
the file.

User avatar
MathiasKettner
Posts: 3
Joined: Sun 09 Nov 2008, 10:59
Contact:

#18 Post by MathiasKettner »

Hi,

the main syntactic problem is, that your lines are ended with CR rather
than LF. Current wirbel expects line feeds. You can help yourself for
example with

Code: Select all

tr \\r \\n < t2.w > t3.w
. Also you need a linefeed
at the end of the file.

The other problem is, that though Wirbel is very similary to Python it
is not exactly like Python (and cannot be for several reasons). Converting
programs like the one you attached to Wirbel is not difficult but neccessary.

A few hints for differences between the two languages are here
http://mathias-kettner.de/wirbel_differ ... ython.html.
Also many library functions differ from those in Python.

Greetings,

Mathias

Lobster wrote:Mathias your programming language is rejecting me :?

Code: Select all

# wirbel t2.w
input buffer overflow, can't enlarge buffer because scanner uses REJECT
Error while compiling t2.w -> t2.
# 
What did i do to it?

code (converting from python) enclosed
[/code]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#19 Post by BarryK »

Okay, here is the latest version, compiled for Puppy 4.x.

This is how I compiled it and created the PET package (of course you need the 'devx_411.sfs' file loaded to be able to compile):

# tar -zxf wirbel-0.1.10.tar.gz
# cd wirbel-0.1.10
# ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
# make
# new2dir make install
# cd ..
# dir2pet wirbel-0.1.10-i486

If you have installed the earlier Wirbel PET pkg, uninstall that first.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#20 Post by BarryK »

Version 0.1.10 has an interesting new feature. This is an email that I have just received from Mathias:
I'm glad to announce that I've implemented a little feature
into Wirbel that you've inspired. It's now (0.1.10) possible
to embedd variable and even expressions into strings - very
much like in the shell but even more flexible. You'll find
here how it works:

http://mathias-kettner.de/wirbel_dollarstrings.html

You'll need the most current version (0.1.10):
My earlier request to him was this:

I want to rewrite this Bash code in Wirbel:

Code: Select all

if [ -f /root/.usb-drive-log-probedisk ];then #force /proc upate mechanism
 for ONEUSBDRV in `cat /root/.usb-drive-log-probedisk | tr '\n' ' '`
 do
 dd if=/dev/$ONEUSBDRV of=/dev/null bs=512 count=1 >/dev/null 2>&1
#v4.01 faster.
 done
fi
It would be so nice if I could do this:

Code: Select all

if fs::file_exists("/root/.usb-drive-log-probedisk"):
 f=fs::file("/root/.usb-drive-log-probedisk")
 for line in f.readlines():
 if not line.empty():
  system("dd if=/dev/${line} of=/dev/null bs=512 count=1 >/dev/null 2>&1")
 f.close()
...that is, I wanted to be able to insert a Wirbel variable into the system() shell script at runtime, in the above example, the variable 'line'.
[url]https://bkhome.org/news/[/url]

Post Reply