Programming for Puppy
Programming for Puppy
I know this has been discussed several times but here's my opinion on what Puppy has/needs...
Puppy aims to be a no-brainer for new users (especially ex-Windows users) and the majority of programs should therefore be gui based.
In Puppy, size matters so some options are non-starters. For example, ljones compiled several dialects of basic a couple of which were feature-rich but require the interpreter or at least binding to the interpreter resulting in a minimum program size of 1Mb plus - far too big for a small app in Puppy.
Tiny C doesn't do GUI. Other C's might but they are probably too bloaty.
The various shell script + X windows dialog options seem to allow only sequential programming (gtkdialog seems to be the exception, promising an event-driven gui interface but documentation in Puppy is scant and gtkdialog's homepage has no docs. For a potential developer the problem is compounded since there is a 'gtk dialog' within the gtk+ package - try Googling for the right one!).
Applications could be written on some other Linux and compiled for Puppy but imho being able to develop within is the best method of ensuring total compatibility.
So what does Puppy need from my point of view? A means to create GUI based programs that are small and event driven. Speed is not an issue so interpreted languages would be fine. It may be that one of the included options *could* fullfil these criteria but imho the syntax of the scripting languages is too obtuse/arcane.
I have in mind a couple of very simple applications that would be useful (and possibly even impressive!) to Windows emigrants but I feel held back by the lack of a suitable development tool. Let me give an example...
Many windows users will not have experienced the command line but when they move to Puppy they will hopefully begin to explore Linux and the shell. I took a look at the options for starting rxvt and see that we can set a background image for the terminal window along with font and cursor colours etc. Now, a small simple program could be written to configure this terminal session to make it rather more appealing to our user. Sure we could edit our ICEWM menu file or whatever to achieve this but why not have a simple 'configuration utility' that would do this for us? It should be a simple 'one window' application allowing the user to choose all the necessary options - image, colour, font etc etc. However, trying to code that with the tools available seems to be far too difficult unless we opt for a choose image, now choose font, now choose colour, now choose cursor...... sequential script.
Personally I'm not averse to learning a new 'language' to advance the cause of Puppy but the present tools seem to be too much of a 'hotch-potch'.
It may be that a suitable all-encompassing programming language does not exist in Linux (or even if it does, would not fit within the tight constraints that Puppy imposes).
As a realtively new Linux user I know I'm asking to be shot down in flames here but what the heck - I'd love to be able to help Puppy along with some small, 'open', custom built applications.
Puppy aims to be a no-brainer for new users (especially ex-Windows users) and the majority of programs should therefore be gui based.
In Puppy, size matters so some options are non-starters. For example, ljones compiled several dialects of basic a couple of which were feature-rich but require the interpreter or at least binding to the interpreter resulting in a minimum program size of 1Mb plus - far too big for a small app in Puppy.
Tiny C doesn't do GUI. Other C's might but they are probably too bloaty.
The various shell script + X windows dialog options seem to allow only sequential programming (gtkdialog seems to be the exception, promising an event-driven gui interface but documentation in Puppy is scant and gtkdialog's homepage has no docs. For a potential developer the problem is compounded since there is a 'gtk dialog' within the gtk+ package - try Googling for the right one!).
Applications could be written on some other Linux and compiled for Puppy but imho being able to develop within is the best method of ensuring total compatibility.
So what does Puppy need from my point of view? A means to create GUI based programs that are small and event driven. Speed is not an issue so interpreted languages would be fine. It may be that one of the included options *could* fullfil these criteria but imho the syntax of the scripting languages is too obtuse/arcane.
I have in mind a couple of very simple applications that would be useful (and possibly even impressive!) to Windows emigrants but I feel held back by the lack of a suitable development tool. Let me give an example...
Many windows users will not have experienced the command line but when they move to Puppy they will hopefully begin to explore Linux and the shell. I took a look at the options for starting rxvt and see that we can set a background image for the terminal window along with font and cursor colours etc. Now, a small simple program could be written to configure this terminal session to make it rather more appealing to our user. Sure we could edit our ICEWM menu file or whatever to achieve this but why not have a simple 'configuration utility' that would do this for us? It should be a simple 'one window' application allowing the user to choose all the necessary options - image, colour, font etc etc. However, trying to code that with the tools available seems to be far too difficult unless we opt for a choose image, now choose font, now choose colour, now choose cursor...... sequential script.
Personally I'm not averse to learning a new 'language' to advance the cause of Puppy but the present tools seem to be too much of a 'hotch-potch'.
It may be that a suitable all-encompassing programming language does not exist in Linux (or even if it does, would not fit within the tight constraints that Puppy imposes).
As a realtively new Linux user I know I'm asking to be shot down in flames here but what the heck - I'd love to be able to help Puppy along with some small, 'open', custom built applications.
PaulR,
Well, it does seem like what you are asking for is Tcl/Tk... which is in Puppy, is highly documented, can do anything, especially GUI. There are lots of apps already in Puppy written in Tcl/Tk.
I could be writing many small Wizards in Tcl/Tk, but it's a question of getting up to speed in the language -- I am still learning Bash/Ash! (keep discovering new things about it all the time).
We do have a resident Tcl/Tk programming expert, "jesse", who was working on MUT, a new partiton mount/unmount tool -- but jesse got called away with heavy work commitments -- he sent me an email that he will be back sometime!
Well, it does seem like what you are asking for is Tcl/Tk... which is in Puppy, is highly documented, can do anything, especially GUI. There are lots of apps already in Puppy written in Tcl/Tk.
I could be writing many small Wizards in Tcl/Tk, but it's a question of getting up to speed in the language -- I am still learning Bash/Ash! (keep discovering new things about it all the time).
We do have a resident Tcl/Tk programming expert, "jesse", who was working on MUT, a new partiton mount/unmount tool -- but jesse got called away with heavy work commitments -- he sent me an email that he will be back sometime!
tcc rocks
well I checked out the tiny C tcc .pup . it's cool and in the original tcc debian pack there is a example .c with access to X so GUI is not impossible.
this tcc is real cool , only it misses complex numbers as defined in ISO99-C (there are libs to take care of that tho)
tcc pretty much gives programming to PUPPY, maybe alongside the lua .pup
this tcc is real cool , only it misses complex numbers as defined in ISO99-C (there are libs to take care of that tho)
tcc pretty much gives programming to PUPPY, maybe alongside the lua .pup
tcl-tk devkit
for gettin into tcl-tk you may wanna run kanotix liveCD which has a fully working Development IDE all set up. once you got it , u can transfer to puppy
it's KDeveloper suporting all sorts of languages and all
it's KDeveloper suporting all sorts of languages and all
tcl-tk devkit
There is Visual tcl that Lobster is using.
To run the combobox example you need to follow the instructions in the README.txt.
Basically what it says is to open rxvt and type in
wish
and when wish starts type in
cd /usr/lib/combobox-2.3
then type
source example.tcl
this will open the demo of combobox.
To run the combobox example you need to follow the instructions in the README.txt.
Basically what it says is to open rxvt and type in
wish
and when wish starts type in
cd /usr/lib/combobox-2.3
then type
source example.tcl
this will open the demo of combobox.
tcc
http://www.goosee.com/puppy/sforum/simp ... 238&page=2
probably the abovementioned thread. I compiled a simple textapp (mersenne-sieve) with tcc in puppy, but GNUchess still fails me for header reasons and all. a distro w/o chess is not a real thing imho
probably the abovementioned thread. I compiled a simple textapp (mersenne-sieve) with tcc in puppy, but GNUchess still fails me for header reasons and all. a distro w/o chess is not a real thing imho
Re: tcl-tk devkit
I am a great believer in GUI programming environments and Visual tcl has an environment that will be familiar to VB programmers and others. Tcl language is scripted and that is a good thing and the future (the code is by nature open) The truth is, I am working on a small program and trying my outmost not to use any code (just the GUI)Ian wrote: There is Visual tcl that Lobster is using.
m m m . . . may have to start programming too . . .
Of the available languages in Puppy remember
ASH is a script language and the most widely used (by Barry). This would undoubtedly be a good and quick way to get involved with Puppy - maybe by creating a wizard - look at the projects from the Puppy web site . . .
TinyC is working towards ISO compliance and I would suggest is suitable for experienced programmers.
Tcl will be familiar to C programmers
Lua is a small language and it would be interesting to see something in Puppy from this language? Anyone?
forth experiment and tcl/tk
I've been working on a Forth development environment for years.
A proof-of-concept version written in JavaScript is here:
http://freeveda.org/forth/
Thinking about doing it in tcl/tk for Puppy Linux.
A proof-of-concept version written in JavaScript is here:
http://freeveda.org/forth/
Thinking about doing it in tcl/tk for Puppy Linux.
Forth Development Environment on Puppy
Imagine: a Forth development environment on a bootable CD of only 50 MB!
I haven't done any programming. I've always thought that Forth looked like the right approach to doing it though, hoped to find if anyone agreed.
Have you tried ColorForth, JaDy?
I haven't done any programming. I've always thought that Forth looked like the right approach to doing it though, hoped to find if anyone agreed.
Have you tried ColorForth, JaDy?
colorForth
No, never tried colorForth. Looked here: http://www.colorforth.com/
Don't see the point. Guess one has to try it to see the utility.
Don't see the point. Guess one has to try it to see the utility.
Programming for puppy
Hi PaulR & Puppy Programmers,
I've been trying to complete my mut program for Puppy for a while now, and yes I tend to agree that Puppy needs to have something like a C compiler, not because I think it would be nice, or that I prefer writing apps in C, but for the practical aspect of being able to use a tool to recreate itself, i.e. the C compiler GCC can recompile itself, where as an interpreted program may be able to output itself (source code), but ususally it won't be able to output the binary program that is the interpreter. It's like being the lobster and choosing to move into the pot, only then realizing that your only options are the pan or the fire. It is a hastle to have to reboot just to do a small compile, its also detrimental to spirit of programming for fun.
I think that tcl/tk comes very close to being the ideal all-in-one solution for what would be the programming environment for Puppy, though it cannot compile the linux kernel (that I'm aware of). But for just making up a quick GUI, its very good, and it provides the ability to make very complex programs.
The nature of tcl/tk is procedural rather than functional, so there is no distinction between say a boolean, an integer, and a string, and there isn't the ability to use structures (like in C), the only complex data structures you can use are arrays and lists, that is the nature of a procedural language, and this is good enough for most everyday type programming. But tricky to grasp if you regularly use C.
The bigest hurdles you'll face in programming in puppy is when you need to do binary data manipulation, or make function calls which are not yet supported. For the Mut project I am working on, these hurdles are the ioctl() function for controling devices, and scanning the binary data on devices to see what filesystem they contain. For those programs I use mandrake linux, gcc, make, kate (text procesor with a shell) to create binary applications which are called by the tcl/tk script program.
Perhaps we need a tcl/tk programming forum where we can support each others learning with tcl/tk, I'd be happy to help out now and then with answering questions. If we want more puppy specific programs, having an enviroment where they can grow is a good idea.
The best thing I found for learning tcl/tk is a program called TclTutor, because it runs in tcl/tk and you can change the sample programs and rerun them to see how it works, and actualy having the full tcl/tk documentation on hand is a very good idea!
Highly reccomended TclTutor:
http://www.msen.com/~clif/TclTutor.html
Get the full documentation for Tcl/Tk:
http://www.tcl.tk/man/
Jesse
I've been trying to complete my mut program for Puppy for a while now, and yes I tend to agree that Puppy needs to have something like a C compiler, not because I think it would be nice, or that I prefer writing apps in C, but for the practical aspect of being able to use a tool to recreate itself, i.e. the C compiler GCC can recompile itself, where as an interpreted program may be able to output itself (source code), but ususally it won't be able to output the binary program that is the interpreter. It's like being the lobster and choosing to move into the pot, only then realizing that your only options are the pan or the fire. It is a hastle to have to reboot just to do a small compile, its also detrimental to spirit of programming for fun.
I think that tcl/tk comes very close to being the ideal all-in-one solution for what would be the programming environment for Puppy, though it cannot compile the linux kernel (that I'm aware of). But for just making up a quick GUI, its very good, and it provides the ability to make very complex programs.
The nature of tcl/tk is procedural rather than functional, so there is no distinction between say a boolean, an integer, and a string, and there isn't the ability to use structures (like in C), the only complex data structures you can use are arrays and lists, that is the nature of a procedural language, and this is good enough for most everyday type programming. But tricky to grasp if you regularly use C.
The bigest hurdles you'll face in programming in puppy is when you need to do binary data manipulation, or make function calls which are not yet supported. For the Mut project I am working on, these hurdles are the ioctl() function for controling devices, and scanning the binary data on devices to see what filesystem they contain. For those programs I use mandrake linux, gcc, make, kate (text procesor with a shell) to create binary applications which are called by the tcl/tk script program.
Perhaps we need a tcl/tk programming forum where we can support each others learning with tcl/tk, I'd be happy to help out now and then with answering questions. If we want more puppy specific programs, having an enviroment where they can grow is a good idea.
The best thing I found for learning tcl/tk is a program called TclTutor, because it runs in tcl/tk and you can change the sample programs and rerun them to see how it works, and actualy having the full tcl/tk documentation on hand is a very good idea!
Highly reccomended TclTutor:
http://www.msen.com/~clif/TclTutor.html
Get the full documentation for Tcl/Tk:
http://www.tcl.tk/man/
Jesse
Programming for puppy
Hi Jesse.
We have a page on the Wikki about tcl programming
http://www.goosee.com/puppy/wikka/TclTk
Its very basic but we had to start somewhere, maybe you could make some suggestions if you have the time.
We have a page on the Wikki about tcl programming
http://www.goosee.com/puppy/wikka/TclTk
Its very basic but we had to start somewhere, maybe you could make some suggestions if you have the time.
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
Re: Programming for puppy
I do agree with the compile using tinyc and I know Barry has always been keen on the tinyc compiler. In fact I belong to a highly dedicated and rare group of Lobsters, trained to prepare the source (or is the sauce) before climbing in the pot, having turned on the heat. Our motto is "Enjoy - US!". It may seem strange but we provide this as a service and gift.Jesse wrote:
it's like being the lobster and choosing to move into the pot, only then realizing that your only options are the pan or the fire. It is a hastle to have to reboot just to do a small compile, its also detrimental to spirit of programming for fun.
Jesse
[ahem . . . meanwhile in the real world]
My feeling is that programming is something you must start cooking with almost immediately. Unless you are going to learn something strange such as 'smalltalk'. I believe Bash or tcl will create immediate potential and useful results within a short time. Some of my long term dreams for Puppy: (I have decided that Linux Tmxxine which is based on Puppy, should not diverge from Puppy unless required - At the moment I do not foresee that as happening)
ASQ language development in Puppy
Puppy on mobile phones
Quantum Puppy. Puppy on Quantum computers.
http://www.zen45800.zen.co.uk/asq3/
latest:
http://tmxxine.com/Wikka/wikka.php?wakk ... evelopment
ASQ is not yet in development.
tcl is as you say a way in. Any language is a way in, some easier than others.
Ian has been kind enough to give me a few tips on tcl and I welcome the idea of a project/tutorial. One of the great things about Linux is how people "Learn by doing". It is almost incredible how big that Tux is . . .
Last edited by Lobster on Fri 26 May 2006, 06:01, edited 1 time in total.
Programming for puppy
I'm sorry I am not currently able to work on the wiki because it is treating me like an "ID ten t".
It does not explain what a "WikiName" is, nor why one is required. Perhaps this is intentional, but it certainly doesnt inspire me to go to the hastle of finding out what it means or how to get around it.
Your tcl page is a nice idea but doesn't really even scratch the surface of the basics. Like how the shell determines how to run a script file in a particular interpreter, how to set execute flag, or even were to look for more information. I would like to help but getting a login is posing a hastle, maybe I'll look into it another time when I have more patience.
Jesse
It does not explain what a "WikiName" is, nor why one is required. Perhaps this is intentional, but it certainly doesnt inspire me to go to the hastle of finding out what it means or how to get around it.
Your tcl page is a nice idea but doesn't really even scratch the surface of the basics. Like how the shell determines how to run a script file in a particular interpreter, how to set execute flag, or even were to look for more information. I would like to help but getting a login is posing a hastle, maybe I'll look into it another time when I have more patience.
Jesse
Re: Programming for puppy
It does somewhere !Jesse wrote: It does not explain what a "WikiName" is,
Jesse
Basically a WikiName is just a username, but in Wiki format. By that it means stick another capital letter in it somewhere. EG. Jesse isn't a Wiki format, but JesSe is.
The wiki is growing at a tremendous rate atm, I've been checking it quite a lot for various things and it's certainly where all the knowledge should be stored.
Rich