Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 23 Sep 2014, 16:25
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Unbloated coding resources
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Author Message
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Fri 07 Oct 2011, 13:35    Post subject:  Unbloated coding resources
Subject description: code bloat, language bloat, license bloat
 

I have decided to start really learning how to program, and didn't want to start off with bad bloat habits, so I have been doing research on the topic for quite some time. So long that some of the better bloat-light example have gone into hiatus. It's probably time I started posting some findings.

I don't have enough time to post a philosophical statement on the subject or reasoning behind my choices, so I am just posting the projects at the moment.

Here they are in no particular order:
Ssl/encryption ... libtomcrypt
Imaging ... stb_image (nothings.org) or nanojpeg+lodepng+webp
Ecmascript (aka javascript) ... see-3.1.1424.tar.gz (currently unmaintained), duktape
OpenGL ... tinyGL <<== SDL implementation
Html5 ... hubbub
Css ... libcss
Svg ... libtinysvg
Lua ... stua (nothings.org)
Freetype ... stb_freetype
Tcl ... jimtcl
Ogg ... stb_ogg
Gcc ... llvm+clang or tcc
Java ... avian
Perl ... microperl (distributed with perl)
Python ... tinypy
Ruby ... tinyrb
GUI ... sdl + agar + tekui ...
Gnu-utils ... Googles toolbox, busybox, embutils, toybox...
Video ... Webm
Mp3 ... minimp3, pdmp3
libc... musl, uclibc, bionic,diet,bsd...
Libstdc++ ... uclibc++, stlport, eastl, ustl, libcxx, libcpp,... the sgi stl,
More to follow.

_________________
Web Programming - Pet Packaging 100 & 101

Last edited by technosaurus on Sat 13 Sep 2014, 06:52; edited 1 time in total
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5031
Location: Arizona, U.S.A.

PostPosted: Sun 09 Oct 2011, 00:25    Post subject:  

Do check out "gtk-server" at: http://www.gtk-server.org/
It works with any interpreted language to make GTK+ GUIs.
It uses absolute coordinance, or hBox / vBox, or table box ( best ).

I`m stuck at a point with a mod. I`m writing to simplify it`s syntax.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sun 09 Oct 2011, 12:42    Post subject:  

Here is the most interesting part of gtk-server:
Quote:
The configfile also defines which GTK libraries should be used. Next to the regular GTK libraries any library can be specified, like Glade, GtkMozEmbed, GtkGlArea, GtkGlExt, but also libc, libmikmod and so on!
so it appears that anything written in C can be used. I need to check on the license though.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5031
Location: Arizona, U.S.A.

PostPosted: Sun 09 Oct 2011, 16:48    Post subject:  

Yeah... I neglected to mention that part, I hadn`t played with it yet though.
It appears to be totally open and can be expanded in almost any manner.!

Here`s the GPL doc. that Peter posted at the web site:
http://www.gtk-server.org/gpl.txt
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2162
Location: The Blue Marble

PostPosted: Mon 10 Oct 2011, 02:55    Post subject:  

technosaurus wrote:
Here is the most interesting part of gtk-server:
Quote:
The configfile also defines which GTK libraries should be used. Next to the regular GTK libraries any library can be specified, like Glade, GtkMozEmbed, GtkGlArea, GtkGlExt, but also libc, libmikmod and so on!
so it appears that anything written in C can be used. I need to check on the license though.

That's what I was hinting in my post here http://murga-linux.com/puppy/viewtopic.php?t=72142. The tarball contains a few non-GTK demo scripts: one that uses gtk-server to call libmikmod to play a MOD file, and one that uses ncurses.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
jamesjeffries2

Joined: 27 Apr 2008
Posts: 196

PostPosted: Fri 11 Nov 2011, 14:28    Post subject:  

You may also be interested in the TinyCCompiler. Not sure about the size of the code it produces but it's pretty inspirational if nothing else!
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sat 12 Nov 2011, 03:51    Post subject:  

tcc could go in the list I guess, but not because it is a small compiler (the compiler is a choice of the end user or packager and _should_ be irrelevant to the developer except to test that code compiles with it) - just because it can be used to run c code as a scripting language (with it, who needs gtkserver)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5031
Location: Arizona, U.S.A.

PostPosted: Sat 12 Nov 2011, 14:45    Post subject:  

Quote:
Just because it can be used to run c code as a scripting language (with it, who needs gtkserver)

# Interesting... Some code examples would be great...

But I imagine that GTK+ code would look about the same as gtk-server.
The Q would be which ran the code faster. Kinda hard to say...
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sat 12 Nov 2011, 16:15    Post subject:  

The tcc web site uses the linux kernel as the example of using C as a script, but you can use pretty much anything that you can compile on a single line (you can specify multiple files and defines - I've done it with jwm, rxvt and others)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Sat 12 Nov 2011, 17:59    Post subject: tcc  

Dear puppians,

Some time ago I asked Peter (GTK-server and BaCon) to include a compile option for tcc, which he kindly did (quite some time ago), since I thought it would be nice to have an unbloated minimal development environment (tcc and BaCon) for tiny Puplets. I compiled tcc and then tried compiling a few things in C and in BaCon and discovered that the resulting binaries were immense. Technosaurus could probably figure out why this is the case and provide a nice solution. I didn't pursue it...but if tcc could be made to generate tiny binaries it would indeed be a useful.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5031
Location: Arizona, U.S.A.

PostPosted: Sun 13 Nov 2011, 16:43    Post subject:  

That`s something you don`t think about...

tcc may not have many options and methods for stripping and reducing size.
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Sun 13 Nov 2011, 17:31    Post subject:  

Can't remember which thread this was, but I think Big_bass compiled some bacon binaries in tinycc and after upxing, they were of reasonable size.

Regards,
s
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Tue 15 Nov 2011, 01:22    Post subject:  

I don't know if tcc uses the -s flag or just ignores it (as it does with all unsupported flags) but it doesn't matter because ...

you get a smaller binary with:
strip -s -R .note -R .comment *
or for libs
strip --strip-unneeded -R .note -R .comment *.so*

fyi, Rob Landley is debating on relicensing toybox to a more permissive license
http://landley.net/notes-2011.html#13-11-2011

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Wed 17 Oct 2012, 05:08    Post subject:  

a couple new ones to add (both permissively licensed)
axtls - light alternative to openssl
klone - web server with builtin application framework that uses compiled C

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 490
Location: State of Jefferson

PostPosted: Fri 19 Oct 2012, 15:02    Post subject:  

perl:
also miniperl (perl builds microperl to start configuring, then miniperl to finish that, then builds perl itself); it's a lot closer to full perl.
CC/gcc: also pcc http://pcc.ludd.ltu.se/ - there are some very recent fixes you may want if you use it.
code is around 30-40% larger, if musl libc.so is taken as representative
browser:
retawq is the smallest I've seen; links2 in gui mode aka xlinks is the smallest with a reasonable gui (retawq offers an X version, but uses xcurses/pdcurses to do it)
asmutils is small, though it is so feature-starved that it may be unusable; klibc-utils is standard for initramfs.
gettext-tiny (https://github.com/rofl0r/gettext-tiny) is a package to fake having gettext/libintl when you don't want it.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0801s ][ Queries: 13 (0.0054s) ][ GZIP on ]