Unbloated coding resources

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

Unbloated coding resources

#1 Post by technosaurus »

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.
Last edited by technosaurus on Sat 13 Sep 2014, 10:52, edited 1 time in total.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2 Post by sunburnt »

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.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#3 Post by technosaurus »

Here is the most interesting part of gtk-server:
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 [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#4 Post by sunburnt »

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

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#5 Post by jamesbond »

technosaurus wrote:Here is the most interesting part of gtk-server:
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: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesjeffries2
Posts: 196
Joined: Mon 28 Apr 2008, 00:50

#6 Post by jamesjeffries2 »

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!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

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 [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#8 Post by sunburnt »

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...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#9 Post by technosaurus »

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 [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

tcc

#10 Post by vovchik »

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

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#11 Post by sunburnt »

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

tcc may not have many options and methods for stripping and reducing size.

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

#12 Post by seaside »

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

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#13 Post by technosaurus »

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 [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#14 Post by technosaurus »

Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#15 Post by Ibidem »

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.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#16 Post by jamesbond »

This thread should be pinned, it is very useful.
Also, klone is super cool :)
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#17 Post by technosaurus »

I forgot to add ph7 engine for embedded php.
http://ph7.symisc.net/downloads.html
It uses a Berkeleydb/sleepycat style license

And baresip voip library (bsd license)
http://www.creytiv.com/baresip.html
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#18 Post by Ibidem »

Pnglite http://sourceforge.net/projects/pnglite/
is a very small (<1k lines) read/write png library; it's one header and one C file.

The stb_* stuff is meant for demos only, afaict.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#19 Post by technosaurus »

another voip

https://code.google.com/p/umurmur/
since it can use polarssl, it should be able to handle one of the BSD maintained versions of xyssl (bsd licensed project polarssl was forked from)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#20 Post by technosaurus »

I need to go through these pages and point out the best ones but till then:

Lots of json, sqlite and other C related stuff:
http://fossil.wanderinghorse.net/repos/
Various C stuff:
http://git.suckless.org/
http://suckless.org/other_projects
http://wiki.musl-libc.org/wiki/Alternative_libraries
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply