Page 2 of 26

Posted: Mon 16 Mar 2009, 15:15
by DMcCunney
Lobster wrote:What requirements are needed to make Genie (our text editor)
You mean Geany...
have support for Genie? (I should know this)
Define "support".

Geany is one of a number of editors based on Neil Hodgson's Scintilla edit control. For a probably incomplete list, see http://texteditors.org/cgi-bin/wiki.pl? ... itorFamily

Scintilla provides syntax highlighting and code folding for supported languages. To add support for a language, you need to create a lexer for Scintilla, which describes the structure and syntax of the language. You can find instructions on doing that here: [url]http://www.scintilla.org/Lexer.txt[/quote]

Once lexers are created, you ought to be able to use Geany to create/edit genie/vala code, and use the IDE features to build your projects. IDE support for things like automatically displaying the results when your code is compiled and run may be another matter. I haven't looked into Geany enough to say.

Geany also lacks scripting support. That's not part of Scintilla. It's available in some other Scintilla based editors, like ScTE, which uses Lua as the script language.
______
Dennis

Posted: Mon 16 Mar 2009, 15:29
by MU
I uploaded a slightly hacked IDE.

http://dotpups.de/puppy4/dotpups/Progra ... enie-test/

It can compile the Genie *.gs files.
As by default, it creates *.vala files, you must create a empty .gs by hand, and then add it to an existing project.
You then can delete the generated main.vala.

I also uploaded the file I patched, project.vala.
Find the two patches by searching for "//MU".


Mark

Posted: Mon 16 Mar 2009, 15:36
by Lobster
Define "support".
You just did - many thanks.
Enrico, the Geany developer (thanks for spelling info my spelling is
atros . . . atrocu . . . bad!) is on this forum.
So hopefully he will offer support if he hears about Genie/Vala . . .

Hey Mark will try your modified IDE next :)

Posted: Mon 16 Mar 2009, 15:55
by Lobster
Mark I installed it once and could not get it working (Valide loaded but I was unable to compile - due to not following your instructions fully)
Tried again and got this even after deleting and uninstalling old version . . . so will have to reinstall - which might take a while . . .
There was an error expanding package valide-0.4-1-i686-Genie-4.tar.gz.
Either the file is corrupted, or has not expanded into its own directory with
name of valide-0.4-1-i686-Genie-4/ (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...

Posted: Mon 16 Mar 2009, 16:01
by MU
might be a broken download.
I just downloaded and installed it at home in NYP, this works.
So the file is not corrupt.
Please try to download again.
Mark

Posted: Mon 16 Mar 2009, 16:17
by MU
Like this you quickly can test it:

create a new Project.
I created one called "Genie", Gtk.
So I have /root/valide/Genie/

When it finished, exit the IDE.
Rename with your filemanager:

/root/valide/Genie/main.vala
to:
/root/valide/Genie/main.gs

Start the IDE again, and open your project.
Now right-click main.vala, and choose "add".
There add "main.gs".
And delete "main.vala" with a rightclick.
It still is listed, as you just renamed it, but it still is shown, as the IDE uses a internal filelist, to manage projects.
At this point, the IDE crashes.
It still is somewhat buggy :(

But if you open again now your project, you can enter Genie code in main.gs, and "save - compile - execute".

This example works:

Code: Select all

[indent=2]

init

  var a = "test"
  print("%s" , a)

Version 0.4 was released on march, 10th, so I hope that soon bugfixes will be added.
We should inform the developer of the IDE about this thread.
I think it might be pretty motivating to see people using it :)
Mark

Posted: Mon 16 Mar 2009, 18:10
by DMcCunney
Lobster wrote:
Define "support".
You just did - many thanks.
Enrico, the Geany developer (thanks for spelling info my spelling is
atros . . . atrocu . . . bad!) is on this forum.
So hopefully he will offer support if he hears about Genie/Vala . . .
Er. you're asking him to create Scintilla lexers for Genie/Vala for use in Geany?

Generally speaking, authors of editors based on Scintilla don't write lexers for specific languages. Users who program in those languages and need support for them do. The user understands the syntax and structure of the language, since they code in it. The author of the editor may not have heard of the language.

If you need lexers for Geany and Vala, that might be something you should take a crack at doing.

A SciTE variant called SciTE-st includes a Vala lexer, but it's written in Lua, and can't just be dropped into Geany. (SciTE-st includes Lua as an embedded script language.)

Go here: http://caladbolg.net/scite_st.php

Versions for Windows and Linux are available.
______
Dennis

Posted: Mon 16 Mar 2009, 18:52
by Lobster
This example works:
Hi Mark
Managed to get it working - almost . . .
Followed everything as you suggested but that compiling part does not seem to be doing anything - sometimes I get an error message that the program is already running but I see nothing.

left this out and tried it with tabs - no luck
.

Code: Select all

[indent=2]

Posted: Mon 16 Mar 2009, 20:07
by MU
Lobster, be certain to activate "view - bottom view".
That displays the internal console, where the messages from your program are printed.

Sidenote:
the forum is extremely slow, so I also will be in the #puppylinux IRC chat, maybe we can find a solution there quicker than here :)

Mark

Posted: Mon 16 Mar 2009, 20:36
by MU
there also should be created a executable by compiling your application.
And be sure, to save, before you compile (other IDEs like Eclipse remind you, if the file changes, Valide does not, so you must remember to save. I forget this sometimes).

You also can test/use the generated executable outside of the IDE, like this (maybe the path is different for you, if you saved to a different folder):

cd /root/valide/Genie
./Genie


Or:
/root/valide/Genie/Genie

Mark

Posted: Tue 17 Mar 2009, 04:27
by Lobster
MU wrote:Lobster, be certain to activate "view - bottom view".
That displays the internal console, where the messages from your program are printed.
Thank goodness there are smart people guiding the idiot cructaceans . . .
That did it
Works fine :D

Posted: Tue 17 Mar 2009, 05:14
by Lobster
Mark are you more inclined to use Vala
because of your java experience? 8)
I am more inclined to Genie . . .

The reason I ask is because if we have a list
of reserved words for Genie that might be a way for the programmers of
Valide to provide some colour coding
and support both languages?
I believe this exists for Vala but not Genie?

Posted: Tue 17 Mar 2009, 17:02
by MU
No, I like both.
Vala is more like C/Java, Genie like Basic.

I concentrate on vala, because there is more documentation.
So to get startet, I tried vala, then I can try to port the programs to Genie.

Concerning Syntax-highlighting, I think further modifications of the IDE would be required.
I hesitate to mess around in foreign code.
I would suggest, that you contact the author:
http://code.google.com/p/valide/
http://valaide.blogspot.com/

I think it would be better, if you do it, not me.
I already have this "tunnel-view", so would not see requirements for beginners.
So I think you could suggest more "basic" issues, that would have priority at the current state.
---------------------------------------------------
I attach a new example.
This was a "pain in the *", it took a whole day, to find out, how it works.

It is an extended version of the Glade example now written in Genie.
During compilation you get a warning, but you can ignore it.

I added two helper functions, that allow to set values like a buttontext on the Window, that was generated from the gladesample.glade.

If you use other widgets, you had to add corresponding helperfunctions, but they are very simple.
Make a copy of "get_button", and rename "button" to the type of widget, that you need to access.

Unlike C, vala/genie does not allow Widget-conversion.
This will not work:

Code: Select all

GtkWidget *w;
w=glade_xml_get_widget(xml, "button1");
Gtk_button_set_label(GTK_BUTTON(w) , "testtext");
This is not possible:
GTK_BUTTON(w)

The new helperfunctions work around that issue.

Mark

Posted: Wed 18 Mar 2009, 09:18
by Lobster
I already have this "tunnel-view", so would not see requirements for beginners.
OK I am in a strange place (quite usual for me)
I could not drag .gs files into an editor or open them in a text editor

the only command that worked was

Code: Select all

cat v1.gs
from the terminal . . .

So I am in the process of reinstalling genie
and getting it to work from the command line again . . .
in a new run of Puppy (setting puppy up was easy)

I have no idea what or how I broke things . . .
downloading every stray pet under the sun and
wearing no tin hat might be part of it ;)

Is anyone else playing with genie?
What ya doing? :)

Posted: Wed 18 Mar 2009, 12:18
by Lobster
I would suggest, that you contact the author:
Hey Mark
I wrote to the author:
Barry Kauler (creator of Puppy Linux) is adopting Vala/Genie
http://puppylinux.com/genie/

and MU one of our top coders is exploring and adapting
Valide to run Genie

Is Genie support and colour syntax coding planned for future valide releases?
with a link to this forum
and have got 'Geni(e)de' working again

Now to try your GTK example . ..

Posted: Wed 18 Mar 2009, 14:38
by MUguest
The examples now also work in Windows.

They require to add some files to a standard Vala installation, and to add options to the compiler.

Everything is here:
http://dotpups.de/puppy4/dotpups/Progra ... r-Windows/
see "readme.txt" for details.

Mark

Posted: Wed 18 Mar 2009, 18:41
by Lobster
Mark
Vala or Valide is making my system unstable (running 4.2 rc3)

Ideally I would recompile for 4.2 or wait for an update of Vala or use 4.12
The main problem is not being able to edit text files.
They seem to lock.

I may have wait until 4.2 final is released this week
and take it from there . . .
or maybe go straight to woof alpha 3 hopefully with added Vala

It is good to be on the cutting edge but I am being shredded . . .

Hopefully more intrepid programmers will join us soon ;)

Posted: Wed 18 Mar 2009, 19:11
by MU
Lob, first thanks for writing to the author.

Second, I'm very surprised, about your issues.
I can not imagine, what causes this, as vala and valaide do not modify anything in the system.

Do your problems remain after a reboot?
When exactly do they begin?
I would compile an example in console.
Then try the IDE.

Mark

Posted: Thu 19 Mar 2009, 02:54
by Lobster
MU wrote:Lob, first thanks for writing to the author.
No problem :D
This is what Nicolas has written back
Hello,

I have planned Genie support for Val(a)IDE.

Currently I work on auto completion, after this I think I will work on
genie support.
So Genie support is coming.
Second, I'm very surprised, about your issues.
I can not imagine, what causes this, as vala and valaide do not modify anything in the system.
not good.

I install nvidia support
and flash 10 Beta
then Vala
then Valide
Valide is working
but I need to access files
Text editing is basic and I get a lock up
- I can not open .gs as text files
Rebooting does not help
Do your problems remain after a reboot?
When exactly do they begin?
I would compile an example in console.
Then try the IDE.
The problem is Mark
Any level of programming is quite hard for me
Takes a lot of concentration
If the base OS is doing odd stuff
then obviously I become distracted.

Vala and Genie are far too important to let
Lobsterian glitches slow it down.
The difficulties seem to occur when valide is installed

Because it has a file manager this makes me suspect Valide
is taking some liberties.

What I will do is work without it and see what happens.

Need to set up my system again :)

Puppy has Vala
and valour
Brave Pup

Posted: Fri 20 Mar 2009, 06:02
by Lobster
What I will do is work without it and see what happens.
What I have done so far is run 4.2 rc3 and not tweaked Deep Thought- run in Icewm etc
I have been running vala/genie from the command line all yesterday without incident

I have simplified my IMT program
and trying different code
So far . . . (does not quite work incidentally)

Code: Select all

// Infinite Monkey Theorem
// Lobster March 2009
// myLine = myLine.concat(myChars[GLib.Random.int_range(0,myChars.length)])

init
	a:int
	myChars:array of string = {" ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
	myText:string = "i"
	myLine:string = ""
	i:int = 0
	while i<10
		a = GLib.Random.int_range(0,27)
		if myChars[a] is not "i" do continue
		if myChars[a] is not "n" do continue
		print("%d",a)
		print(myChars[a])
		if myChars[a] is "n" do break
Do you know how to use 'Print' continuously rather than with a line break?
Shadow did it here:

Code: Select all

// myLine = myLine.concat(myChars[GLib.Random.int_range(0,myChars.length)])
however that is too hard for me to work out why it works . . . 8)

Anyway just to let you know how I am getting on :)