Author |
Message |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: 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.
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
Last edited by technosaurus on Sat 13 Sep 2014, 06:52; edited 1 time in total
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5089 Location: Arizona, U.S.A.
|
Posted: 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
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: 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.
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5089 Location: Arizona, U.S.A.
|
Posted: 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
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3475 Location: The Blue Marble
|
Posted: 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 forum links: Latest version | Contributed packages | ISO builder
|
Back to top
|
|
 |
jamesjeffries2
Joined: 27 Apr 2008 Posts: 196
|
Posted: 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
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: 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)
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5089 Location: Arizona, U.S.A.
|
Posted: 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
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: 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)
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1538 Location: Ukraine
|
Posted: 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
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5089 Location: Arizona, U.S.A.
|
Posted: 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
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 937
|
Posted: 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
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: 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
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: 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
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
Ibidem
Joined: 25 May 2010 Posts: 553 Location: State of Jefferson
|
Posted: 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
|
|
 |
|