Re: [dev] What is bad with Go [formerly: What is bad with Python]

2014-03-05 Thread Strake
On 04/03/2014, Bobby Powers  wrote:
> Strake wrote:
>> * Member selection is in some cases cumbersome, in which it would not
>> be in C, which is related to ¬(variant types)
>
> Can you explain more what you mean?

I can't quite remember the particulars. My case was a λ-calculus
interpreter, which had to switch on program structure, and I remember
solely that it was cumbersome. Perhaps I wrote unidiomatic code, but I
couldn't find the appropriate idiom if any such is.



Re: [dev] What is bad with Python

2014-03-04 Thread Strake
FRIGN  wrote:
> You can write beautiful and readable code in any language.

[assuming that "you" means the reader in general, not S. Jegen in particular]

False. I can't write such code in MATLAB, for example.

> A question to everyone on this list: What do you think about the Go-language?

I'm not a fan:

• Case-sensitive exports seem wonky to me
• Interfaces rather than variant types [but not interfaces per se] are weak
• Member selection is in some cases cumbersome, in which it would not
be in C, which is related to ¬(variant types)

Mind, my experience is little, and this is merely what I found writing
a λ-calculus interpreter in Go.



Re: [dev] l9fb: Linux framebuffer over 9p server

2013-12-26 Thread Strake
On 26/12/2013, yy  wrote:
> You could maybe build such a thing on top of l9fb, but I don't think this
> would be such an improvement over directly using the fb device.

The reason for l9fb is to have a common interface whether it's the raw
framebuffer, an aggregate surface of many framebuffers, a window, an
OpenGL texture on a spinning cube, or whatever else. So far only the
first is made.



Re: [dev] l9fb: Linux framebuffer over 9p server

2013-12-25 Thread Strake
On 25/12/2013, Lee Fallat  wrote:
> Neat although maybe not so practical. There would be lots of latency
> over a remote network, but locally I can see this being ok.

Yes, this is meant to be local. Remote graphics likely ought to be
vector rather than raster.

> How could you make it so that you can compress the out-going video?

Variously, but it would unsimplify the system, and I'm not sure
whether it would help much. If wanted, tho, one could reserve a
compressed /img over 9p with another program.



[dev] l9fb: Linux framebuffer over 9p server

2013-12-25 Thread Strake
https://github.com/strake/l9fb

Future goals:
* make a terminal emulator
* make a tiling window organizer with same interface
* make the X window system my ex-window system



Re: [dev] [sbase][RFC] Add a simplistic version of tr

2013-12-24 Thread Strake
On 24/12/2013, Silvan Jegen  wrote:
> So I guess the question boils down to whether you would rather use
> libutf or the standardized, POSIX-locale-dependent wchar.h functions for
> the UTF-8 conversion.  I see one advantage of the wchar.h functions:
> If we use them we could avoid adding an external dependency to
> sbase. The disadvantage is the fact that we would depend on the
> whole posix-locale-thing which seems unnecessarily complicated in
> places.

Use wchar.h functions and a sane libc, e.g. musl, which has a pure
UTF-8 C locale, which ISO C explicitly allows [1].

The 8-bit clarity what POSIX wants [1] seems nonsense to me, as one
can use byte functions for that, but I may be wrong.

[1] http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc



Re: [dev][announce] Optimizing C compiler & c++ compiler/runtime

2013-12-20 Thread Strake
On 20/12/2013, Rob  wrote:
> https://github.com/bobrippling/ucc-c-compiler

Why are you rewriting libc?



Re: [dev] Optimizing C compiler & c++ compiler/runtime

2013-12-20 Thread Strake
On 20/12/2013, Sylvain BERTRAND  wrote:
> That's very bad. Linux kernel devs have not accepted patches to
> allow compilation with alternative C compilers??

Well, Linus is no gcc fan [1], so they might, if a ready alternative
were available.

[1] https://lkml.org/lkml/2006/11/28/206



Re: [dev] wswsh: a mksh web framework

2013-12-13 Thread Strake
On 13/12/2013, Nick  wrote:
> On a related note, for those who like him, Eben Moglen just did an
> excellent series of talks

It's not the FSF's doctrine that loses; it's GNU's shitty code.

> Browsing the web nowadays feels like having engineers
> and advertisers constantly shouting "fuck you" at me.

This.

I just tell them to take a number.



Re: [dev] wswsh: a mksh web framework

2013-12-13 Thread Strake
On 13/12/2013, Paul Onyschuk  wrote:
> [Markdown] is still non-strict,

I missed this. Where is evaluation order specified?

> Sed, awk, grep and other standard tools work great with sane roff
> document: you can stick to the oneliners (I don't think that this can
> be said about any other document format).

Yes, and that these tools lose on non-line-based formats is their
fault, not the format's.
See http://doc.cat-v.org/bell_labs/structural_regexps/



Re: [dev] wswsh: a mksh web framework

2013-12-12 Thread Strake
On 12/12/2013, Troels Henriksen  wrote:
> No, that was year 100.  2014 is the year of MMXIV.

Anyhow, this is actually the year 44.



Re: [dev] wswsh: a mksh web framework

2013-12-12 Thread Strake
On 12/12/2013, Neo Romantique  wrote:
> C is generally more and efficient, I suppose.

I assume you mean "more efficient".

It may be more for the machine but it's less for the programmer.

We build machines to do tedious work so we needn't.



Re: [dev] [wiki] Add suckless init

2013-12-12 Thread Strake
On 12/12/2013, YpN  wrote:
> Do you think I could add a section about init? I know ignite and busybox 
> init, it might be interesting.

Rich Felker, author of musl, wrote an init too, but I can't find it now.

Here is mine, much alike: https://github.com/strake/init/blob/master/init.c



Re: [dev] [wiki] Add suckless init

2013-12-12 Thread Strake
On 12/12/2013, Strake  wrote:
> Rich Felker, author of musl, wrote an init too, but I can't find it now.

Sorry, that ought to be "primary author".



Re: [dev] [sbase][RFC] Add a simplistic version of tr

2013-11-28 Thread Strake
On 28/11/2013, Silvan Jegen  wrote:
> On Thu, Nov 28, 2013 at 11:45:33AM -0500, Strake wrote:
>> > (either using UTF-8 or UTF-32 indices), right?
>>
>> I meant Unicodepoints; those are just Unicodecs.
>
> UTF-32 is an encoding that is identical to the unicode point as far as
> I know. So what I am thinking is that one would either use the UTF-8
> representation of the Unicode point as an index, or the unicode point
> itself. Since using UTF-8 would not require any conversion (on UTF-8
> locales) I think it would be preferrable.

UTF-8 has variable width, so one must find the length of the sequence
anyhow and shift it bytewise into an integer, so one may as well just
use fgetwc or the like and work with codepoints.



Re: [dev] [sbase][RFC] Add a simplistic version of tr

2013-11-28 Thread Strake
On 28/11/2013, Silvan Jegen  wrote:
> If I understand correctly you would use mmap to allocate a sparse
> memory area into which we could then directly index

Yes.

> (either using UTF-8 or UTF-32 indices), right?

I meant Unicodepoints; those are just Unicodecs.

> Since mmap needs a file descriptor argument

It's ignored for anonymous map.



Re: [dev] [sbase][RFC] Add a simplistic version of tr

2013-11-26 Thread Strake
On 26/11/2013, Silvan Jegen  wrote:
> If you you would rather not take this version, what approach would
> you take for the character set mapping when using UTF-8?

On Linux, one can easily make a sparse array with 1-page granularity
with mmap, and so simply use a (wchar_t []) or (Rune []), but I'm not
sure how portable this is.



Re: Asshole vs. reality [was: Re: [dev] Question about arg.h]

2013-11-12 Thread Strake
On 12/11/2013, Martti Kühne  wrote:
> On Thu, Nov 7, 2013 at 3:54 PM, Strake  wrote:
> ...
>> for an actual fault, for example a bottom post, is no flame.
>>
>
> Logical fallacies that are obvious are an edge case, I guess... It's
> top posting we don't like.

Sorry, yes, I meant top post.



Re: Asshole vs. reality [was: Re: [dev] Question about arg.h]

2013-11-07 Thread Strake
"Asshole vs. reality" would be an appropriate subtitle for "suckless:
the movie".

Alas, the list smells ever of phosphorus and kerosene, as some would
rather flame than argue rationally. But slamming someone for an actual
fault, for example a bottom post, is no flame.



Re: [dev] Some thoughts about XML

2013-10-18 Thread Strake
On 18/10/2013, Szymon Olewniczak  wrote:
> I believe that we can make the web the better place without huge revolutino

s/HTML/XML+XSLT/g is quite a revolution.

> (such as changing HTTP to something else)

Which is this about, HTTP or HTML?

> Pages writen in XML has readable source

So have pages written in Microsoft Word; a read call will fill my
buffer with it.
Readable ≠ readily parsible.



[dev] Re: [st] XOpenIM failed

2013-10-18 Thread Strake
On 17/10/2013, Strake  wrote:
> I am trying to use st, but it fails with the message "XOpenIM failed.
> Could not open input device."
>
> ...

Never mind; I wrote my own lookupString function. It's not
particularly good, lacking ability beyond ASCII, but I'll post it if
someone asks.



Re: [dev] [sbase] Command list

2013-10-18 Thread Strake
On 18/10/2013, sin  wrote:
> find: Useless, just do `du -a | grep blabla'

Yes, this is what one does on Plan 9.

> I realize when xargs is useful, I just hate it.

Yep, the basic function is sane, but the other crap, insert mode and
quotation and such, loses.

On 18/10/2013, Truls Becken  wrote:
> On 2013-10-18, at 12:29, sin wrote:
>
>> find: Useless, just do `du -a | grep blabla'
>
> I'm not interested in disk usage, but finding files based on certain
> properties, such as update time, ownership, permissions, etc.

du -a | cut -f 2

Cheers,
Strake



[dev] [st] XOpenIM failed

2013-10-17 Thread Strake
I am trying to use st, but it fails with the message "XOpenIM failed.
Could not open input device."

I checked the XOpenIM man page, which said that it opens an input
method, so I checked the man page, the X11 header files, the Arch
Linux package repos, and Google hits for "XIM", "X Input Method", and
"XOpenIM failed" but couldn't find what the hell an input method is or
how to actually get or make one. I found the Wikipedia page and the X
Consortium Input Method Protocol spec, but the former is a stub and
the latter is noisy and seems inessential to my case.

I checked the libX11 source, which defines structs _XIM and _XIC, but
they are not defined in a public header and thus opaque to users.

I added some marker syscalls before and after XOpenIM and straced it,
and it tries to open /usr/share/X11/locale.(alias dir) many times
before final failure, so I copied them and the C directory over from
stock Arch Linux, in vain.

I am on Starch Linux, kernel 3.10.7, xorg-server 1.14.2 kdrive Xfbdev,
on a Dell Latitude E4300.

What must I do to use st?



Re: [dev] [st][patch] scrollback buffer

2013-10-16 Thread Strake
On 16/10/2013, Jochen Sprickerhof  wrote:
> I've implemented a (limited) scrollback buffer for st. Thanks to v4hn
> for testing and improving first versions.

Thanks! This was the last reason against my st adoption.

On 16/10/2013, Christoph Lohmann <2...@r-36.net> wrote:
> You  can add it as a patch to the wiki but it won’t be included in main‐
> line.  Scrollback is what you have other applications for. Because  next
> you  will  want  scrollback selection, scrollback editing and scrollback
> history files. Other people solved these problems in software already.

Yes:

* Clearly xterm, rxvt, et al have done, but their lossage is the reason for st.
* Terminal multiplexers have done, but suckless already has its own
terminal multiplexer what hasn't: dwm.



Re: [dev] Re: Talk about suckless

2013-10-10 Thread Strake
On 10/10/2013, FRIGN  wrote:
> On Thu, 10 Oct 2013 08:31:03 -0500
> Strake  wrote:
>
>> On 10/10/2013, Silvan Jegen  wrote:
>> > A day before Christmas Eve, no less.
>>
>> and the Linux kernel cares what day it is?
>>
>
> Yep[1].
>
> [1]: <http://lxr.free-electrons.com/source/include/linux/time.h>

I said "cares", not "knows".

"Oh, it's Christmas, so I won't bother taking this system call today..."



Re: [dev] Re: Talk about suckless

2013-10-10 Thread Strake
On 10/10/2013, Silvan Jegen  wrote:
> A day before Christmas Eve, no less.

and the Linux kernel cares what day it is?



Re: [dev] [announce] Starch Linux is bootable and self-hosting

2013-10-05 Thread Strake
On 05/10/2013, Thorsten Glaser  wrote:
>>Yes, sorry, I missed that it bound to IPv4 alone by default. Should
>>work now. Thanks.
>
> Nope – maybe it’s firewalled (looks like pf block drop)?
>
> tg@blau:~ $ nc -v6 starchlinux.org 80
> nc: connect to starchlinux.org port 80 (tcp) failed: Operation timed out

It's open on my router. Anyhow, I just deleted the  record for now.



Re: [dev] [announce] Starch Linux is bootable and self-hosting

2013-10-05 Thread Strake
On 05/10/2013, Thorsten Glaser  wrote:
> Strake dixit:
>
>>http://starchlinux.org/
>
> “HTTP/1.1 200 Schön”?!

What, is this improper usage?

> One rather important thing: starchlinux.org has got an  RR
> but the httpd does not listen on IP, only on Legacy IP. Please
> fix that, because otherwise, a good part of the ’net can’t ac‐
> cess your site.

Yes, sorry, I missed that it bound to IPv4 alone by default. Should
work now. Thanks.

> bye,
> //mirabilos

Cheers,
S.



[dev] [announce] Starch Linux is bootable and self-hosting

2013-10-04 Thread Strake
I posted about Starch earlier [1]; to remind, it's static-linked
Arch-based Linux distro built against musl. The basic system now works
with a few small glitches. So far, packages for x86_64 are available.

http://starchlinux.org/

[1] http://lists.suckless.org/dev/1210/13050.html



Re: [dev] [sbase] [patch] Optimize 'ls' and add '-U'

2013-07-22 Thread Strake
On 22/07/2013, Charlie Paul  wrote:
> But now we are looking at an even more obscure situation.

Yep, in practice, we'll never have newlines in filenames. And the
Titanic will never sink.

The answer here is to use null rather than newline as a separator.
Alas, The Standard says otherwise.



Re: [dev] coreutils / moreutils - DC a directory counter

2013-07-18 Thread Strake
On 17/07/2013, Calvin Morrison  wrote:
> I came up with a utility[0] that i think could be useful, and I sent
> it to the moreutils page, but maybe it might fit better here. All it
> does is give a count of files in a directory.

$ ls | wc -l

> I was sick of ls | wc -l being so damned slow on large directories, so
> I thought a more direct solution would be better.
>
> calvin@ecoli:~/big_folder> time ls file2v1dir/ | wc -l
> 687560
>
> real0m7.798s
> user0m7.317s
> sys 0m0.700s

$ time sh -c 'ls test | wc -l'
371576
sh -c 'ls test | wc -l'  0.99s user 0.21s system 100% cpu 1.193 total

No bother here. Not sure why yours is so slow.

> I know there is a naming conflict, what does that have to do with the
usage of the program?

Much; I call it by name.

> What was the last time you used the reverse polish notation calculator
that precedes the invention of C?

Today.



Re: [dev] [sbase] shell scripts

2013-07-07 Thread Strake
On 07/07/2013, Markus Teich  wrote:
>> Why are these in C?
>
> Because shell scripts tend to run many processes compared to only one
> if you don't fork in the C code?

Is this a matter of efficiency alone?



[dev] [sbase] shell scripts

2013-07-07 Thread Strake
I see some utilities in sbase what could easily be shorter as
shell/awk scripts. Some utilities I sent in earlier, e.g. cut, were
turned down for this reason.

For examples, head:

#!/bin/sh

n=10;

while getopts 'n:' o; do
case $o in
(n) n="$OPTARG";;
esac
done

shift $(dc -e "$OPTIND 1 - p");

for x in "$@"; do sed ${n}q <"$x"; done

# END

pwd:

#!/bin/sh

echo "$PWD"

#END

Why are these in C?
head.sh now needs dc, but could easily rather use intc [1], which we
could include in sbase.

[1] https://github.com/strake/intc



Re: [dev] [sbase] [patch] Add sha1sum

2013-07-07 Thread Strake
On 04/07/2013, sin  wrote:
> On Thu, Jul 04, 2013 at 12:34:14PM +, Robert Ransom wrote:
>> sha1sum.c is very similar to md5sum.c; ideally, more of the common
>> code between those programs would be in a library routine.
>
> Yeah they are very similar, however, the code is very simple and
> there is not going to be more programs in sbase that will use that code
> as far as I know.

sha512sum?



Re: [dev] [sbase] Adding tar

2013-07-07 Thread Strake
On 06/07/2013, Galos, David  wrote:
> The attached patch shows my current work on adapting sltar
> to sbase. It is functional, but,  there are still open questions
> regarding tar. The big deal is the argument parsing: I would
> like to use the ARG macros in tar, but I'm not sure how that
> fits with the average tar invocation.
>
> In short, how do you fine folks invoke your tar?

$ curl whatever.tar.gz | tar -xz
$ tar -C somewhere -xzf file.tar.gz
$ tar -czf file.tar.gz files

tho if z flag and others such were dropped I would soon adapt and not
miss them. Archiver/compressor integration loses, for it needs a flag
and code for each compression format.

The question is how critical these goals each are in sbase: sanity and
backward-compatibility.

We may wish to have a saner core toolkit, and wrappers around them for
legacy usage.

Not sure yet about the C flag; one could do this:
; @{ cd somewhere; gzip -d | tar -x } 

[dev] Re: [swerc][PATCH] bin/handlers: roll up repeated code; factorize out suffixes

2013-07-03 Thread Strake
Tested now.


>From 309ffdb318e67014b8565335cc1d95e4ff5d506c Mon Sep 17 00:00:00 2001
From: Strake 
Date: Wed, 3 Jul 2013 07:26:16 -0500
Subject: [PATCH 1/2] bin/handlers: roll up repeated code

---
 bin/handlers.rc | 21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/bin/handlers.rc b/bin/handlers.rc
index cca6495..2055ed4 100644
--- a/bin/handlers.rc
+++ b/bin/handlers.rc
@@ -54,6 +54,10 @@ fn man_handler {
 echo ''
 }

+fn 1_handler {
+man_handler $*
+}
+
 fn dir_listing_handler {
 d=`{basename -d $1}
 if(~ $#d 0)
@@ -65,19 +69,12 @@ fn dir_listing_handler {
 }

 fn setup_handlers {
-if(test -f $local_path.md) {
-local_file=$local_path.md
-handler_body_main=(md_handler $local_file)
-}
-if not if(test -f $local_path.1) {
-local_file=$local_path.1
-handler_body_main=(man_handler $local_file)
-}
-if not if(test -f $local_path.tpl) {
-local_file=$local_path.tpl
-handler_body_main=(tpl_handler $local_file)
+local_file=()
+for(suffix in md 1 tpl) if(test -f $local_path.$suffix) {
+local_file=$local_path.$suffix
+handler_body_main=($suffix^_handler $local_file)
 }
-if not if(test -f tpl^$req_path^.tpl)
+if(~ $#local_file 0 && test -f tpl^$req_path^.tpl)
 handler_body_main=(tpl_handler tpl^$req_path^.tpl)
 if(! ~ $#handler_body_main 0)
 { } # We are done
-- 
1.7.11.1


>From e932acfd42a5b8f0d7e7d467916cc00a8ccf962b Mon Sep 17 00:00:00 2001
From: Strake 
Date: Sun, 18 May 2003 15:11:04 -0500
Subject: [PATCH 2/2] factorize out suffixes

---
 bin/handlers.rc |  6 --
 bin/werc.rc | 12 +++-
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/bin/handlers.rc b/bin/handlers.rc
index 2055ed4..e1e246d 100644
--- a/bin/handlers.rc
+++ b/bin/handlers.rc
@@ -1,5 +1,7 @@
 # Werc builtin handlers

+suffixes=(md 1 tpl)
+
 fn nav_tree {
 echo ''
 if(! ~ $#menuTitle 0) {
@@ -12,7 +14,7 @@ fn nav_tree {
 # /./ to deal with p9p's ls failure to follow dir symlinks otherwise
 ls -F $sitedir/./$req_paths_list >[2]/dev/null \
 | {
-sed $dirfilter'/\/[^_.\/][^\/]*(\.(md|1)|\/)$/!d;
s!^'$sitedir'!!; '$dirclean
+sed
$dirfilter'/\/[^_.\/][^\/]*(\.'^$suffix_alternation^'|\/)$/!d;
s!^'$sitedir'!!; '$dirclean
 if(! ~ $#synth_paths 0) echo $synth_paths | tr ' ' $NEW_LINE
 } | sort -u | awk -F/ '
 function p(x, y, s) { for(i=0; i < x-y; i+=1) print s }
@@ -70,7 +72,7 @@ fn dir_listing_handler {

 fn setup_handlers {
 local_file=()
-for(suffix in md 1 tpl) if(test -f $local_path.$suffix) {
+for(suffix in $suffixes) if(test -f $local_path.$suffix) {
 local_file=$local_path.$suffix
 handler_body_main=($suffix^_handler $local_file)
 }
diff --git a/bin/werc.rc b/bin/werc.rc
index 01f4714..5fa22c3 100755
--- a/bin/werc.rc
+++ b/bin/werc.rc
@@ -7,14 +7,16 @@ cd ..
 forbidden_uri_chars='[^a-zA-Z0-9_+\-\/\.,:]'
 difs=$ifs # Used to restore default ifs when needed

-# Expected input: ls -F style, $sitedir/path/to/files/
-#  
-dirfilter='s/\*$//; s,/+\./+,/,g; s,^\./,,; /\/[._][^\/]/d;
/'$forbidden_uri_chars'/d; /\/sitemap\.xml$/d; /\/index\.(md|tpl)$/d;
/\/(robots|sitemap)\.txt$/d; /_werc\/?$/d; '
-dirclean=' s/\.(md|1)$//; '
-
 # Careful, the proper p9p path might not be set until initrc.local is sourced
 path=(. $PLAN9/bin ./bin /bin /usr/bin)

+suffix_alternation='('^`{echo $"suffixes | tr ' ' '|'}^')'
+
+# Expected input: ls -F style, $sitedir/path/to/files/
+#  
+dirfilter='s/\*$//; s,/+\./+,/,g; s,^\./,,; /\/[._][^\/]/d;
/'$forbidden_uri_chars'/d; /\/sitemap\.xml$/d;
/\/index(\.'^$suffix_alternation^')+$/d; /\/(robots|sitemap)\.txt$/d;
/_werc\/?$/d; '
+dirclean=' s/\.'^$suffix_alternation^'$//; '
+
 http_content_type='text/html'
 ll_add handlers_bar_left nav_tree
 werc_root=`{pwd}
-- 
1.7.11.1



[dev] Re: [swerc][PATCH] bin/handlers: roll up repeated code; factorize out suffixes

2013-07-03 Thread Strake
On 03/07/2013, Strake  wrote:
> ...

Sorry, I thought that I tested both, but actually only tested the
first. Second needs work yet.



[dev] [swerc][PATCH] bin/handlers: roll up repeated code; factorize out suffixes

2013-07-03 Thread Strake
>From 309ffdb318e67014b8565335cc1d95e4ff5d506c Mon Sep 17 00:00:00 2001
From: Strake 
Date: Wed, 3 Jul 2013 07:26:16 -0500
Subject: [PATCH 1/2] bin/handlers: roll up repeated code

---
 bin/handlers.rc | 21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/bin/handlers.rc b/bin/handlers.rc
index cca6495..2055ed4 100644
--- a/bin/handlers.rc
+++ b/bin/handlers.rc
@@ -54,6 +54,10 @@ fn man_handler {
 echo ''
 }

+fn 1_handler {
+man_handler $*
+}
+
 fn dir_listing_handler {
 d=`{basename -d $1}
 if(~ $#d 0)
@@ -65,19 +69,12 @@ fn dir_listing_handler {
 }

 fn setup_handlers {
-if(test -f $local_path.md) {
-local_file=$local_path.md
-handler_body_main=(md_handler $local_file)
-}
-if not if(test -f $local_path.1) {
-local_file=$local_path.1
-handler_body_main=(man_handler $local_file)
-}
-if not if(test -f $local_path.tpl) {
-local_file=$local_path.tpl
-handler_body_main=(tpl_handler $local_file)
+local_file=()
+for(suffix in md 1 tpl) if(test -f $local_path.$suffix) {
+local_file=$local_path.$suffix
+handler_body_main=($suffix^_handler $local_file)
 }
-if not if(test -f tpl^$req_path^.tpl)
+if(~ $#local_file 0 && test -f tpl^$req_path^.tpl)
 handler_body_main=(tpl_handler tpl^$req_path^.tpl)
 if(! ~ $#handler_body_main 0)
 { } # We are done
-- 
1.7.11.1


>From de7dfb66068fe2feddcb7d30e95db24712bfe176 Mon Sep 17 00:00:00 2001
From: Strake 
Date: Sun, 18 May 2003 15:11:04 -0500
Subject: [PATCH 2/2] factorize out suffixes

---
 bin/handlers.rc | 8 ++--
 bin/werc.rc | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/bin/handlers.rc b/bin/handlers.rc
index 2055ed4..b68cff6 100644
--- a/bin/handlers.rc
+++ b/bin/handlers.rc
@@ -1,5 +1,9 @@
 # Werc builtin handlers

+suffixes=(md 1 tpl)
+
+suffix_alternation='('^`{echo $"suffixes | tr ' ' '|'}^')'
+
 fn nav_tree {
 echo ''
 if(! ~ $#menuTitle 0) {
@@ -12,7 +16,7 @@ fn nav_tree {
 # /./ to deal with p9p's ls failure to follow dir symlinks otherwise
 ls -F $sitedir/./$req_paths_list >[2]/dev/null \
 | {
-sed $dirfilter'/\/[^_.\/][^\/]*(\.(md|1)|\/)$/!d;
s!^'$sitedir'!!; '$dirclean
+sed
$dirfilter'/\/[^_.\/][^\/]*(\.'^$suffix_alternation^'|\/)$/!d;
s!^'$sitedir'!!; '$dirclean
 if(! ~ $#synth_paths 0) echo $synth_paths | tr ' ' $NEW_LINE
 } | sort -u | awk -F/ '
 function p(x, y, s) { for(i=0; i < x-y; i+=1) print s }
@@ -70,7 +74,7 @@ fn dir_listing_handler {

 fn setup_handlers {
 local_file=()
-for(suffix in md 1 tpl) if(test -f $local_path.$suffix) {
+for(suffix in $suffixes) if(test -f $local_path.$suffix) {
 local_file=$local_path.$suffix
 handler_body_main=($suffix^_handler $local_file)
 }
diff --git a/bin/werc.rc b/bin/werc.rc
index 01f4714..dd77207 100755
--- a/bin/werc.rc
+++ b/bin/werc.rc
@@ -9,8 +9,8 @@ difs=$ifs # Used to restore default ifs when needed

 # Expected input: ls -F style, $sitedir/path/to/files/
 #  
-dirfilter='s/\*$//; s,/+\./+,/,g; s,^\./,,; /\/[._][^\/]/d;
/'$forbidden_uri_chars'/d; /\/sitemap\.xml$/d; /\/index\.(md|tpl)$/d;
/\/(robots|sitemap)\.txt$/d; /_werc\/?$/d; '
-dirclean=' s/\.(md|1)$//; '
+dirfilter='s/\*$//; s,/+\./+,/,g; s,^\./,,; /\/[._][^\/]/d;
/'$forbidden_uri_chars'/d; /\/sitemap\.xml$/d;
/\/index(\.'^$suffix_alternation^')+$/d; /\/(robots|sitemap)\.txt$/d;
/_werc\/?$/d; '
+dirclean=' s/\.'^$suffix_alternation^'$//; '

 # Careful, the proper p9p path might not be set until initrc.local is sourced
 path=(. $PLAN9/bin ./bin /bin /usr/bin)
-- 
1.7.11.1



Re: [dev] Re: Maintaining sbase

2013-06-25 Thread Strake
On 25/06/2013, Martti Kühne  wrote:
> On Tue, Jun 25, 2013 at 4:58 PM, Calvin Morrison 
> wrote:
>> my votes are for at a minimum are for:
>>
>> sponge
>> tee
>> pee
>
> And a cloth to clean up the mess...

No, that's what sponge is for.



Re: [dev] [st] Enter unicode symbol

2013-06-12 Thread Strake
On 12/06/2013, Thuban  wrote:
> Hello,
> stupid question : how can you enter an unicode character in st?
> In vim, you do it with ctrl-u+ (where  is the code)
> In some terminal, you do this with ctrl-shift-u+

Define a compose key.



Re: [dev] Is there any plan on a shell for sbase?

2013-05-31 Thread Strake
On 31/05/2013, Fernando C.V.  wrote:
> Would it make sense to create a whole shell infrastructure based on
> little small commands?
>
> I mean, not just replacing no-brainer builtin things like "echo", etc,
> but also things like "if", "while", "for", "set", by doing system()
> calls to an extremelly minimal shell. Would it make sense? maybe even
> a command for creating pipes.

I tried this lately. Actually, I tried no shell at all.

The basic idea was this: a program is a list of arguments. Each
utility parses the first few arguments and spawns the rest by its
operational scheme, like chroot and setsid. This was the dawn of
grief, for many utilities, for example if, must take many argument
lists. I first tried '--' as list separator, but thus I had to quote
'--'s in the argument list, which I did with another '-'; as I soon
learned, this is very cumbersome.

I mean to try again, this time with s-expressions, which, as they are
balanced, need no quotation.

Cheers,
Strake



Re: [dev] Re: Why HTTP is so bad?

2013-05-24 Thread Strake
On 24/05/2013, Random832  wrote:
> On 05/24/2013 07:13 PM, Strake wrote:
>>> And you spend a day on wikipedia or tvtropes and you've got two hundred
>>> HTML viewers open?
>> Yes.
>
> I meant as opposed to the usual dozen.
>> The viewer sends a "go" message back to the fetcher, which kills the
>> old viewer and loads the new one, and can keep a URL log.
>>
> So the fetcher (which presumably also has UI elements such as an address
> bar, back/forward button, etc)

Such functions, yes.

> is the monolithic browser I described.

If that's what you meant, yes. I just meant the fetcher-viewer integration.

> How exactly is this different from the current model? That the two
> components communicate via IPC rather than an in-process API?

Yes. Thus I can easily swap out any component, or insert mediators
between components. For example, I could write my own fetcher to scrub
the HTTP headers, or block ads; and I wouldn't need plug-ins to view
PDFs or watch movies.



Re: [dev] Re: Why HTTP is so bad?

2013-05-24 Thread Strake
On 24/05/2013, random...@fastmail.us  wrote:
> On Fri, May 24, 2013, at 16:02, Strake wrote:
>> Yes. A web browser ought to have a component to fetch documents and
>> start the appropriate viewer, as in mailcap. The whole monolithic web
>> browser model is flawed.
>
> And you spend a day on wikipedia or tvtropes and you've got two hundred
> HTML viewers open?

Yes.

> You need _something_ monolithic to manage a linear (or, rather,
> branching only when you choose to, via open new window or new tab)
> browsing history, even if content viewers aren't part of it. When you
> click a link within "the appropriate viewer", it needs to be _replaced_
> with the viewer for the content at the link you clicked on.

The viewer sends a "go" message back to the fetcher, which kills the
old viewer and loads the new one, and can keep a URL log.



Re: [dev] Re: Why HTTP is so bad?

2013-05-24 Thread Strake
On 24/05/2013, Dmitrij Czarkoff  wrote:
> There is mime, which can be combined with mailcap in a useful way.

Yes. A web browser ought to have a component to fetch documents and
start the appropriate viewer, as in mailcap. The whole monolithic web
browser model is flawed.



Re: [dev] Re: Why HTTP is so bad?

2013-05-24 Thread Strake
On 24/05/2013, Bjartur Thorlacius  wrote:
> On 05/24/2013 02:11 PM, Christian Neukirchen wrote:
>> Types can't be declared properly in Unix.
> In Unix, filetype are defined on a per file basis.

Yes — file type, not data type.

> Delimeters in IPC text streams are defined using $IFS.
> Rc is hailed exclusively because it makes less use if $IFS. Well, that and 
> the Plan 9 label.

It has saner syntax, too.



Re: [dev] Re: Why HTTP is so bad?

2013-05-24 Thread Strake
On 24/05/2013, Nick  wrote:
> On Fri, May 24, 2013 at 02:02:42PM +0200, Dmitrij Czarkoff wrote:
> Yes. Some site map or apache index style thing that was wholely
> standard and couldn't be "styled" would be very useful.

Over 9p, this would be the directory structure, so it would come for free.



Re: [dev] [st] minor fix

2013-05-06 Thread Strake
On 06/05/2013, Johannes Hofmann  wrote:
> Hi,
>
> there is a small glitch in the error handling of the select() call
> in st.c. See patch below.
>
> Regards,
> Johannes
>
> diff --git a/st.c b/st.c
> index 5251e70..689de26 100644
> --- a/st.c
> +++ b/st.c
> @@ -3481,7 +3481,7 @@ run(void) {
>   FD_SET(cmdfd, &rfd);
>   FD_SET(xfd, &rfd);
>
> - switch(select(MAX(xfd, cmdfd)+1, &rfd, NULL, NULL, tv) < 0) {
> + switch(select(MAX(xfd, cmdfd)+1, &rfd, NULL, NULL, tv)) {
>   case -1:
>   if(errno == EINTR)
>   continue;
>

Why are we even using switch here?

>From 8cf77d2d081702c7e0db2bb8724732ca0fa85410 Mon Sep 17 00:00:00 2001
From: Strake 
Date: Mon, 6 May 2013 06:29:21 -0500
Subject: [PATCH] (if rather than switch) select ...

---
 st.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/st.c b/st.c
index bd157af..1191969 100644
--- a/st.c
+++ b/st.c
@@ -3347,12 +3347,12 @@ run(void) {
FD_SET(cmdfd, &rfd);
FD_SET(xfd, &rfd);

-   switch(select(MAX(xfd, cmdfd)+1, &rfd, NULL, NULL, tv) < 0) {
-   case -1:
+   if(select(MAX(xfd, cmdfd)+1, &rfd, NULL, NULL, tv) < 0) {
if(errno == EINTR)
continue;
die("select failed: %s\n", SERRNO);
-   default:
+   }
+   else {
if(FD_ISSET(cmdfd, &rfd)) {
ttyread();
if(blinktimeout) {
@@ -3364,7 +3364,6 @@ run(void) {

if(FD_ISSET(xfd, &rfd))
xev = actionfps;
-   break;
}
gettimeofday(&now, NULL);
drawtimeout.tv_sec = 0;
-- 
1.7.11.1



Re: [dev] [st][patch] not roll our own utf functions

2013-05-05 Thread Strake
On 05/05/2013, Christoph Lohmann <2...@r-36.net> wrote:
> Greetings.
>
> On Sun, 05 May 2013 16:49:06 +0200 Strake  wrote:
>> From c40205fe15f0da048128f8735fd2140605de5e9e Mon Sep 17 00:00:00 2001
>> From: Strake 
>> Date: Sun, 5 May 2013 09:35:58 -0500
>> Subject: [PATCH] not roll our own utf functions
>
> Rejected due to dependency hell.

It ain't even dependency heck, but meh.



[dev] [st][patch] not roll our own utf functions

2013-05-05 Thread Strake
>From c40205fe15f0da048128f8735fd2140605de5e9e Mon Sep 17 00:00:00 2001
From: Strake 
Date: Sun, 5 May 2013 09:35:58 -0500
Subject: [PATCH] not roll our own utf functions

---
 README|   2 +-
 config.mk |   2 +-
 st.c  | 129 +-
 3 files changed, 11 insertions(+), 122 deletions(-)

diff --git a/README b/README
index 25606a2..2bbb859 100644
--- a/README
+++ b/README
@@ -5,7 +5,7 @@ st is a simple virtual terminal emulator for X which sucks less.

 Requirements
 
-In order to build st you need the Xlib header files.
+In order to build st you need libutf and the Xlib header files.


 Installation
diff --git a/config.mk b/config.mk
index 9431de2..36a0424 100644
--- a/config.mk
+++ b/config.mk
@@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
 INCS = -I. -I/usr/include -I${X11INC} \
`pkg-config --cflags fontconfig` \
`pkg-config --cflags freetype2`
-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft \
+LIBS = -L/usr/lib -lc -lutf -L${X11LIB} -lX11 -lutil -lXext -lXft \
`pkg-config --libs fontconfig`  \
`pkg-config --libs freetype2`

diff --git a/st.c b/st.c
index 8cf3483..da0b6b7 100644
--- a/st.c
+++ b/st.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -394,10 +395,7 @@ static void selcopy(void);
 static void selscroll(int, int);
 static void selsnap(int, int *, int *, int);

-static int utf8decode(char *, long *);
-static int utf8encode(long *, char *);
 static int utf8size(char *);
-static int isfullutf8(char *, int);

 static ssize_t xwrite(int, char *, size_t);
 static void *xmalloc(size_t);
@@ -506,115 +504,6 @@ xcalloc(size_t nmemb, size_t size) {
 }

 int
-utf8decode(char *s, long *u) {
-   uchar c;
-   int i, n, rtn;
-
-   rtn = 1;
-   c = *s;
-   if(~c & B7) { /* 0xxx */
-   *u = c;
-   return rtn;
-   } else if((c & (B7|B6|B5)) == (B7|B6)) { /* 110x */
-   *u = c&(B4|B3|B2|B1|B0);
-   n = 1;
-   } else if((c & (B7|B6|B5|B4)) == (B7|B6|B5)) { /* 1110 */
-   *u = c&(B3|B2|B1|B0);
-   n = 2;
-   } else if((c & (B7|B6|B5|B4|B3)) == (B7|B6|B5|B4)) { /* 0xxx */
-   *u = c & (B2|B1|B0);
-   n = 3;
-   } else {
-   goto invalid;
-   }
-
-   for(i = n, ++s; i > 0; --i, ++rtn, ++s) {
-   c = *s;
-   if((c & (B7|B6)) != B7) /* 10xx */
-   goto invalid;
-   *u <<= 6;
-   *u |= c & (B5|B4|B3|B2|B1|B0);
-   }
-
-   if((n == 1 && *u < 0x80) ||
-  (n == 2 && *u < 0x800) ||
-  (n == 3 && *u < 0x1) ||
-  (*u >= 0xD800 && *u <= 0xDFFF)) {
-   goto invalid;
-   }
-
-   return rtn;
-invalid:
-   *u = 0xFFFD;
-
-   return rtn;
-}
-
-int
-utf8encode(long *u, char *s) {
-   uchar *sp;
-   ulong uc;
-   int i, n;
-
-   sp = (uchar *)s;
-   uc = *u;
-   if(uc < 0x80) {
-   *sp = uc; /* 0xxx */
-   return 1;
-   } else if(*u < 0x800) {
-   *sp = (uc >> 6) | (B7|B6); /* 110x */
-   n = 1;
-   } else if(uc < 0x1) {
-   *sp = (uc >> 12) | (B7|B6|B5); /* 1110 */
-   n = 2;
-   } else if(uc <= 0x10) {
-   *sp = (uc >> 18) | (B7|B6|B5|B4); /* 0xxx */
-   n = 3;
-   } else {
-   goto invalid;
-   }
-
-   for(i=n,++sp; i>0; --i,++sp)
-   *sp = ((uc >> 6*(i-1)) & (B5|B4|B3|B2|B1|B0)) | B7; /* 10xx 
*/
-
-   return n+1;
-invalid:
-   /* U+FFFD */
-   *s++ = '\xEF';
-   *s++ = '\xBF';
-   *s = '\xBD';
-
-   return 3;
-}
-
-/* use this if your buffer is less than UTF_SIZ, it returns 1 if you can decode
-   UTF-8 otherwise return 0 */
-int
-isfullutf8(char *s, int b) {
-   uchar *c1, *c2, *c3;
-
-   c1 = (uchar *)s;
-   c2 = (uchar *)++s;
-   c3 = (uchar *)++s;
-   if(b < 1) {
-   return 0;
-   } else if((*c1&(B7|B6|B5)) == (B7|B6) && b == 1) {
-   return 0;
-   } else if((*c1&(B7|B6|B5|B4)) == (B7|B6|B5) &&
-   ((b == 1) ||
-   ((b == 2) && (*c2&(B7|B6)) == B7))) {
-   return 0;
-   } else if((*c1&(B7|B6|B5|B4|B3)) == (B7|B6|B5|B4) &&
-   ((b == 1) ||
-   ((b == 2) && (*c2&(B7|B6)) == B7) ||
-   ((b == 3) && (*c2&(B7|B6)) == B7 && (*c3&(B7|B6)) == B7))) {
-   return 0;
-   } else {
-   return 1;
-   }
-}
-
-int
 utf8size(char *s) {
uchar c = *s;

@@ -1230,7 

[dev] [st][patch] SWAP macro

2013-05-05 Thread Strake
>From d3455f61a5caaf5d94e2b6c1056fb03713772029 Mon Sep 17 00:00:00 2001
From: Strake 
Date: Tue, 30 Apr 2013 23:53:04 -0500
Subject: [PATCH] swap

---
 st.c | 38 ++
 1 file changed, 10 insertions(+), 28 deletions(-)

diff --git a/st.c b/st.c
index 5251e70..8cf3483 100644
--- a/st.c
+++ b/st.c
@@ -72,6 +72,7 @@ char *argv0;
 #define DEFAULT(a, b) (a) = (a) ? (a) : (b)
 #define BETWEEN(x, a, b)  ((a) <= (x) && (x) <= (b))
 #define LIMIT(x, a, b)(x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
+#define SWAP(t, x, y) { t __SWAP_TEMPORARY; __SWAP_TEMPORARY =
(x); (x) = (y); (y) = __SWAP_TEMPORARY; }
 #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg ||
(a).bg != (b).bg)
 #define IS_SET(flag) ((term.mode & (flag)) != 0)
 #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 +
(t1.tv_usec-t2.tv_usec)/1000)
@@ -1358,10 +1359,7 @@ tnew(int col, int row) {

 void
 tswapscreen(void) {
-   Line *tmp = term.line;
-
-   term.line = term.alt;
-   term.alt = tmp;
+   SWAP(Line *, term.line, term.alt);
term.mode ^= MODE_ALTSCREEN;
tfulldirt();
 }
@@ -1369,16 +1367,13 @@ tswapscreen(void) {
 void
 tscrolldown(int orig, int n) {
int i;
-   Line temp;

LIMIT(n, 0, term.bot-orig+1);

tclearregion(0, term.bot-n+1, term.col-1, term.bot);

for(i = term.bot; i >= orig+n; i--) {
-   temp = term.line[i];
-   term.line[i] = term.line[i-n];
-   term.line[i-n] = temp;
+   SWAP(Line, term.line[i], term.line[i-n]);

term.dirty[i] = 1;
term.dirty[i-n] = 1;
@@ -1390,15 +1385,12 @@ tscrolldown(int orig, int n) {
 void
 tscrollup(int orig, int n) {
int i;
-   Line temp;
LIMIT(n, 0, term.bot-orig+1);

tclearregion(0, orig, term.col-1, orig+n-1);

for(i = orig; i <= term.bot-n; i++) {
-temp = term.line[i];
-term.line[i] = term.line[i+n];
-term.line[i+n] = temp;
+SWAP(Line, term.line[i], term.line[i+n]);

 term.dirty[i] = 1;
 term.dirty[i+n] = 1;
@@ -1531,12 +1523,12 @@ tsetchar(char *c, Glyph *attr, int x, int y) {

 void
 tclearregion(int x1, int y1, int x2, int y2) {
-   int x, y, temp;
+   int x, y;

if(x1 > x2)
-   temp = x1, x1 = x2, x2 = temp;
+   SWAP(int, x1, x2);
if(y1 > y2)
-   temp = y1, y1 = y2, y2 = temp;
+   SWAP(int, y1, y2);

LIMIT(x1, 0, term.col-1);
LIMIT(x2, 0, term.col-1);
@@ -1711,15 +1703,9 @@ tsetattr(int *attr, int l) {

 void
 tsetscroll(int t, int b) {
-   int temp;
-
LIMIT(t, 0, term.row-1);
LIMIT(b, 0, term.row-1);
-   if(t > b) {
-   temp = t;
-   t = b;
-   b = temp;
-   }
+   if(t > b) SWAP(int, b, t);
term.top = t;
term.bot = b;
 }
@@ -2886,7 +2872,7 @@ xdraws(char *s, Glyph base, int x, int y, int
charlen, int bytelen) {
FcPattern *fcpattern, *fontpattern;
FcFontSet *fcsets[] = { NULL };
FcCharSet *fccharset;
-   Colour *fg, *bg, *temp, revfg, revbg;
+   Colour *fg, *bg, revfg, revbg;
XRenderColor colfg, colbg;
Rectangle r;

@@ -2954,11 +2940,7 @@ xdraws(char *s, Glyph base, int x, int y, int
charlen, int bytelen) {
}
}

-   if(base.mode & ATTR_REVERSE) {
-   temp = fg;
-   fg = bg;
-   bg = temp;
-   }
+   if(base.mode & ATTR_REVERSE) SWAP(Colour *, fg, bg);

if(base.mode & ATTR_BLINK && term.mode & MODE_BLINK)
fg = bg;
-- 
1.7.11.1



Re: [dev] [surf] add 3-finger back and forward control

2013-04-21 Thread Strake
On 21/04/2013, Uli Armbruster  wrote:
> * Strake  [21.04.2013 18:37]:
>> Which race has n fingers | n < 3?
>
> Seriously?!?!?!

No.



Re: [dev] [surf] add 3-finger back and forward control

2013-04-21 Thread Strake
On 21/04/2013, Christoph Lohmann <2...@r-36.net> wrote:
> Btw. »3 fingers«  is really racist to people only having two or just one 
> finger.

Which race has n fingers | n < 3?



Re: [dev] [st] wide characters

2013-04-15 Thread Strake
On 15/04/2013, random...@fastmail.us  wrote:
> On Mon, Apr 15, 2013, at 10:58, Martti Kühne wrote:
>> According to a quick google those chars can become as wide as 6
>> bytes,
>
> No, they can't. I have no idea what your source on this is.

In UTF-8 the maximum encoded character length is 6 bytes [1]

[1] Linux docs: man 7 utf-8

This is more than a four-byte integer ('‿')



Re: [dev] web benchmark

2013-04-14 Thread Strake
On 14/04/2013, Christoph Lohmann <2...@r-36.net> wrote:
> The  benchmark  consists  of  running  every website on a RPi Model B in
> surf, count how long it takes to load the website and compare the  value
> of reaction time and loading time to a reference website. If the website
> is unusable (reaction time > 0.1s) automatically send a bomb  threat  to
> postmaster@website.

Why loading time? Latency may well be due to the network between, not
their server.

Measuring the web's sanity with WebKit; the irony...

> All  of  this  might result in websites offering a stripped down website
> (not just for mobile or tablets) for embedded devices or us  just  being
> ignored.

... or thrown in jail.



Re: [dev] [st] windows port?

2013-04-12 Thread Strake
On 12/04/2013, Max DeLiso  wrote:
> I really only still run windows because I play
> some games which only run on windows.

Wine?



Re: [dev] [st] windows port?

2013-04-11 Thread Strake
On 11/04/2013, Max DeLiso  wrote:
> I completely agree that Windows is a legacy OS, but plenty of people are
> still forced to use it for many legitimate reasons.

Forced? How? At knifepoint?



Re: [dev] [st] st 0.4 slow startup

2013-04-06 Thread Strake
On 06/04/2013, Igor Šarić  wrote:
> Pardon my ignorance, but how do I find commit 9c44229c? All the commits on
> git webpage have longer (sha1?) hashes.

That string should be a prefix of the hash.



Re: [dev] [st] New feature idea

2013-03-29 Thread Strake
On 29/03/2013, Calvin Morrison  wrote:
> See opening images is not the same as having images on your buffer, namely 
> for the reason
> of being able to look back in your buffer and see the images that have been 
> opened
>
> say I wanted all my photos in my collection from 2012, 3rd month, for
> me this is now trivial, plus
> I can easily scroll up and down my buffer to look at them.

but st has no scrollback buffer.



Re: [dev] Re: [slcon] Call for Papers 2013

2013-03-25 Thread Strake
On 25/03/2013, hiro <23h...@gmail.com> wrote:
> So then weak is rather sufficient. Sorry, it sounded like this up
> there was your wishlist.

It was.

> Now it got to be a good example of what I really don't need in my init 
> scripts :)

Glad to help.



Re: [dev] Re: [slcon] Call for Papers 2013

2013-03-25 Thread Strake
On 25/03/2013, hiro <23h...@gmail.com> wrote:
> That's all fixable without creating huge systems or frameworks.

I agree. I never said that I want a huge system or framework.

> I think you're just confused from what ubuntu made you think is useful.

I think you're just confused about whether you're talking to a now or
former Ubuntu user.

> I have no need for any of this shit to be done automagically.

Acknowledged.



Re: [dev] Re: [slcon] Call for Papers 2013

2013-03-25 Thread Strake
On 23/03/2013, hiro <23h...@gmail.com> wrote:
>> initscripts are weak.
>
> what do you need them to do? what does weak really mean here?

Sorry, my comment was indeed vague.

I meant the Arch initscripts, tho this may well be true of many:

* won't automatically re-start service that dies; network services in
particular, e.g. tunnels, may fail due to transient network phenomena
* can't automatically start services what another service needs
* can't easily start non-root user services



Re: [dev] Re: [slcon] Call for Papers 2013

2013-03-22 Thread Strake
On 21/03/2013, Christian Neukirchen  wrote:
> I would like to give a talk called "runit & ignite - a suckless init
> system?", but I'm asking whether there is interest first since I noticed
> these projects in the suckless context yet.
>
> runit is a reliable init system based on service supervision, and ignite
> is a set of shell scripts to convert the init system of a well-known
> Linux distribution starting with "A" to use runit.  (No worries, the
> concepts are generic enough to be applied on every Linux or *BSD
> system.)
>
> I think a 30min talk would be enough to present it, and I'd like to have
> enough time for discussion later since this is a topic that is getting
> increasingly relevant given the current introduction of systemd
> everywhere.  It's also interesting for the sta.li plans, I think.

I won't be there but I would be very interested. initscripts are weak.



Re: [dev] web browsers

2013-03-10 Thread Strake
On 10/03/2013, hiro <23h...@gmail.com> wrote:
> are there any other new usable browsers lately? other ideas,
> recommendations?

Netsurf, maybe? It's written in pure C, at least.

http://netsurf-browser.org

Cheers,
Strake



Re: [dev] [announce] linuxutils

2013-03-02 Thread Strake
On 02/03/2013, Chris Down  wrote:
> I like the idea. mountpoint.sh could be improved. Do you prefer
> patches as a GitHub pull request or by git format-patch?

The former, tho either is cool.

Cheers,
Strake



[dev] [announce] linuxutils

2013-03-01 Thread Strake
rather than util-linux, which is crap.

https://github.com/strake/linuxutils

Very incomplete yet, just mount, umount, mountpoint, setsid, and
pivot_root, but ultimately I hope to have a full tool set.

Cheers,
Strake



Re: [dev] Suckless and Wayland

2013-02-13 Thread Strake
On 13/02/2013, Hugues Moretto-Viry  wrote:
> I already started a similar topic some months ago where I asked you your
> opinion.
> Now, the project seems to move fast, this is why I start another
> subject.
> The aim is different now, and I want to have some details from Suckless
> community / developpers about the upcoming technology.
>
> After reading many Wayland articles, I think it will completely change
> Linux ecosystem and I'm a bit worried.

Well, what is its natural predator?

> Wayland introduces fuzzy aspects and they're not very clear for me (POSIX
> compliant, KMS and network transparency).
>
> Since I like many softwares like dwm & st, I wonder how I'll do when Wayland 
> will become the norm (as systemd).
> I really hope you consider porting your essentials softwares on Wayland,

I really hope we don't.

> because major distribs like Fedora or Ubuntu plan to use it.

They can use clay tablets for all I care.

> I think it's a dilemma: using your work on non-Wayland distribs or dropping
> my favorites softwares for Wayland...

No dilemma here.

> Here my concerns (I'm not the only one, I guess).

The only one in this thread so far.



Re: [dev] Suckless generic diagram creation software?

2013-02-06 Thread Strake
On 06/02/2013, Peter Hartman  wrote:
> 2013/2/6 Manolo Martínez :
>> On 02/06/13 at 03:29pm, Peter Hartman wrote:
>>> LaTeX
>>>
>> I use and love LaTeX, but LaTeX is *not* lightweight.
>
> Depends on the measure, but it is lighter both in terms of its source,
> memory footprint, and deps than any app based on gtk.

That is a poor measure.



Re: [dev] [st] Shift+F1 should by F11?

2013-01-10 Thread Strake
On 10/01/2013, Mihail Zenkov  wrote:
>> I have also tested in the virtual terminal of the kenel (you called it
>> 'pure console') and I get the values you said:
>>
>>
>>   Shift-F1 = ^[[25~
>>   F11 = ^[[23~
>
> I check again - in my system I have ^[[23~ for Shift+F1 and F11. Can
> some one else also check this?

I get the same as k0ga:
F11 = ^[[23~
Shift-F1 = ^[[25~

Linux 3.4.6-1-ARCH

This makes sense if indeed Shift-F1 = F13.



Re: ls -s vs. du (was: Re: [dev] [st] font fallback)

2013-01-07 Thread Strake
On 07/01/2013, Raphael Proust  wrote:
> Real difference is du handles hard links (i.e. shows actual disk usage
> (as one would expect) by counting hard-linked files only once) while
> ls list files (as one would expect) (and optionally gives some
> information about them). Which wins.

Ah, yes, I missed this. Unix wins again.
Plan 9 ls has no R flag, which makes sense if truly ls's job is to
list directories and du's job is to delve deep, tho Unix 8th ls has
the flag.

On another note, I find it sadly amusing how "an unbelievable number
of options" [1] is fewer than most have today.

[1] http://man.cat-v.org/unix_8th/1/ls



Re: ls -s vs. du (was: Re: [dev] [st] font fallback)

2013-01-06 Thread Strake
On 06/01/2013, pancake  wrote:
> Didnt checked, but i guess that ls -s show size in bytes and du in block
> bytes, which depends on filesystem.

Nope. Both show size in blocks [1].

It seems proper to do so in ls alone, with a flag of whether to add
sizes of all files below; thus we could drop du. One may argue that
the job of ls is not to add sizes, but now we have 2 utilities what
list files, which loses.

[1] http://www.openbsd.org/cgi-bin/man.cgi?query=(ls, du)



Re: [dev] Starch has a mailing list

2012-12-08 Thread Strake
On 08/12/2012, Hugues Moretto-Viry  wrote:
> Subscribed.
> About installer, why not fork Arch-Install-Scripts?
> https://github.com/falconindy/arch-install-scripts

I may at some time, but my priority is a full self-hosted build.



[dev] Starch has a mailing list

2012-12-08 Thread Strake
What it says.

d...@lists.starchlinux.org
http://lists.starchlinux.org/listinfo.cgi/dev-starchlinux.org

Cheers,
Strake



Re: [dev] Re: Starch has a web site

2012-12-08 Thread Strake
On 08/12/2012, lordkrandel  wrote:
> On 08/12/2012 05:30, Kai Hendry wrote:
>> Stick to a mailing list with Web archives.
>
> I've always thought that forums, bbs and mailing lists are
> "plain old hierarchical filesystems" gone astray. These tools represent
> bad implementations of written communication between users.
>
> Imagine threads as folders, mails as files, subthreads as subfolders.
> Users should be able to create their topics and posts, but not to modify
> or delete anything. The mantainer can compress the topics with gz when
> it's time to make an archive.
>
> If you do not care about their user base, and also do not care about
> integration with mail clients, just share a folder over 9p, FTP, HTTP or
> whatever.
>
> SMTP and POP suck hard.

Well, web fora, yes, but a mailing list is actually a decent model of
written communication between users. True about SMTP. I never use BBSs
or POP so I can make no worthy comment.

The forum could be a mere sticky directory, which would allow all
normal forumnal activities. The difficulty is how to share it: the
only user ID is the server's, so UID checks are in vain; even with 9p,
which can authenticate a remote user, it must then set its UID, and I
will not have such a server working as root!
I could check UIDs in the server, but that means more code...
A mailing list is easier to configure.

In this case, I'm limited too by the host machine, which is not mine.



Re: [dev] Re: Starch has a web site

2012-12-07 Thread Strake
On 07/12/2012, hiro <23h...@gmail.com> wrote:
> forums

and the plural is "fora".



[dev] Re: Starch has a web site

2012-12-07 Thread Strake
On 07/12/2012, hiro <23h...@gmail.com> wrote:
> it asked me if tux is cute and after I answered it isn't the web site
> said I'm a robot. please just go on using mailing lists. forums (and
> most other web shit) suck.

Try now (^_~)



[dev] Re: Starch has a web site

2012-12-07 Thread Strake
On 07/12/2012, Hugues Moretto-Viry  wrote:
> A lightweight forum could be useful too.

I agree. Ergo, I added one.

http://starchlinux.org/Forum/



[dev] Re: Starch has a web site

2012-12-06 Thread Strake
Julian Dammann wrote:
> What's a 9p feed?

that I serve my news directory over 9p (^_~)

Truls Becken wrote:
> Where should discussions take place?
> The home page does not mention any community links.

Well, we have none yet, but we have a few options:

* Mailing list
My preferred, but as the site is on someone else's server, and
unfortunately I had to delegate them the whole domain, this may be
difficult.

* werc bridge
Tried it; not sure how to configure it. I had the form but posting a
comment failed.
I may try further in future, but mind, I will be busy with exams for
the next 11 days or so.

> The installation guideline suggests using the Arch installer. That's fine, 
> but I'd just like to mention that I always found it fascinating how you can 
> install Arch by booting any Linux system you have at hand (an existing 
> installation or some live cd), download a static build of pacman, mount the 
> partition you want to install on, and simply run; ./pacman -S base -r /mnt

Yes, true. I added a note to InstallationGuide.

> All the best with this new distro.

Thanks.

Cheers,
Strake



[dev] Re: Starch has a web site

2012-12-06 Thread Strake
Hugues Moretto-Viry wrote:
> Dude, I can tell you I'm very interested about this project.
> I will follow you.
> Good work!

Thanks!

James Christopher Hogg wrote:
> I am interested too.
> If you'll avoid systemd, dbus and similar stuff, I'll think about 
> contribution.

Like the plague.

Prakhar Goel wrote:
> Have you thought of using something like NIX?

Yes.

> The implementation sucks

Horribly.

> but the idea there: completely reproducible builds is incredible.

Yes, and easy portable configuration.
These are neat ideas, and could be done well, but that's another distro.

Raphael Proust wrote:
> Any plan to integrate an RSS feed?

No.

> (or similar?)

Maybe a 9p feed.

Prakhar Goel wrote:
> Also, may I recommend s6 as the init system? It follows the suckless 
> philosophy:
> mionimal, does exactly what is needed and is stable.

Yes, thanks for the tip. I must further study the options.

Cheers,
Strake



[dev] Starch has a web site

2012-12-05 Thread Strake
Hello all. Starch Linux has its own web site now:
http://starchlinux.org
so further announcements will be made there.

As a reminder, the earlier thread: http://lists.suckless.org/dev/1210/13050.html
Ports: https://github.com/StarchLinux/starch-ports

Cheers,
Strake



Re: [dev] [suckless] Migration to git

2012-11-27 Thread Strake
On 27/11/2012, Raphael Proust  wrote:
> darcs?
>
> (Yes, I know, it's not written in C. The interface is very clean
> though. There is no branching, no history rewritting, no bells and
> whistles.)

It's not in C, but Haskell code can be easily compiled and distributed
in binary form.

Darcs has no history edition, as it essentially keeps no history,
which is a win in my book. The main difficulty seems to be the
corner-case exponential-time merge algorithm.



Re: [dev] I'm back

2012-11-18 Thread Strake
On 18/11/2012, Bjartur Thorlacius  wrote:
> GNU Stow also.

Oh, yeah, that's what we need: more perl.



Re: [dev] I'm back

2012-11-18 Thread Strake
Jens Staal  wrote:
> I agree with this. As an example distribution, Sabotage does things pretty
> well. One detail that I like a lot (but it sort of depends on your stance on
> symlinks) is the way applications usually are placed in it:
> Each application gets its own directory under /opt and then installed files
> get symlinks in / (the file system hierarchy is stali-inspired with
> everything in root and usr just pointing back to root).
>
> For me, this is a nicer solution than for example pacman to keep track on
> which files that belong to which package (no fragile databases needed).

One may use stacking bind mounts rather than symlinks. I know no
decent such fs in Linux kernel space, as aufsn and unionfs seem
cumbersome, but it ought to not be too difficult in user space, as 9p
server.

> What I have noticed lately is however how much of the broken stuff that are
> expected to build also relatively fundamental technologies. For example, mesa
> (which is needed if one ever wants to run wayland instead of X) expects
> libudev to build, and if the version requirements will increase further that
> will basically force systemd on peopole.

Free software, captive society.

> I am starting to think of this as the Fragile X syndrome, which usually refers
> to a genetic disease causing mental retardation 
> (http://en.wikipedia.org/wiki/Fragile_X_syndrome ).
> I am starting to feel that Linux is having a serious case of its digital 
> variant.

Ha! Nice.

Anselm Garbe  wrote:
> I'm back in the game ;)

Welcome back! It's your move.



Re: [dev] [announce] rat - ridiculously abysmal tar

2012-11-07 Thread Strake
On 07/11/2012, hiro <23h...@gmail.com> wrote:
>> Which languages qualify as suckless?
>
> C, body language.


Language




Re: [dev] [announce] rat - ridiculously abysmal tar

2012-11-07 Thread Strake
On 07/11/2012, Joerg Zinke  wrote:
> Loglan is way to over-engineered and bloated.
> toki pona to the rescue!

"Training your mind to think in Toki Pona can lead to many deeper
insights about yourself or the world around you." [1]

Well, it can lead to many shallow insights about its creator.

[1] http://en.tokipona.org/wiki/What_is_Toki_Pona%3F



Re: [dev] [announce] rat - ridiculously abysmal tar

2012-11-07 Thread Strake
On 06/11/2012, Alex Hutton  wrote:
> Which languages qualify as suckless?

Only Unicode-extended Lazy K.
λ is for wimps.



Re: [dev] [st] 0.3 release

2012-11-05 Thread Strake
On 05/11/2012, Brandon Invergo  wrote:
> The mission then is to put on some deep sea diving gear and wade into the 
> murky depths of xterm code

s/deep sea diving/hazmat/



Re: [dev] [st] 0.3 release

2012-11-05 Thread Strake
On 05/11/2012, Brandon Invergo  wrote:
> First, to see what I'm talking about:
> 1) Open a terminal and start some CPU monitor (ie top or htop)
> 2) Open another terminal and load a rather large man page (try
> termcap(5))
> 3) Start scrolling down on the man page and watch your Xorg process's
> CPU usage spike. Depending on how fast your computer is, this can be
> anywhere from ~10%-75% CPU usage (15% on this quad-core Intel Core2Pro,
> 75% on my 800mhz Arm Cortex A8)
> 4) Try the same experiment with xterm or urxvt: no CPU spike

I tried this and found that st version 386 actually does better, i.e.
lower CPU usage, than urxvt.



Re: [dev] Troff for typsetting e-mails

2012-10-28 Thread Strake
On 28/10/2012, Luis Anaya  wrote:
>>> On Sun, Oct 28, 2012 at 01:21:40PM +0100, hiro wrote:
>>> > typesetting? raw text can be typeset just fine with a keyboard. not
>>> > sure what you're really up to.
>>> >
>>>
>>> It is suckless answer to HTML email.
>>>
>> It might as well *be* HTML email.
>
> Because it is. A rose of any other name is...

?

Troff ≠ HTML.



Re: [dev] [announce] Starch Linux: static-linked Arch Linux

2012-10-26 Thread Strake
On 25/10/2012, Strake  wrote:
> Someone just told me that my server is unreachable. I thought I had it
> working again, but clearly I was wrong. Sorry about this; I'll try to
> unbreak it or find an alternative soon.

Sorry about this. Ought to be reachable now. Got new IP, forgot to change DNS.

Ports now also available on github: https://github.com/strake/starch-ports



Re: [dev] [announce] Starch Linux: static-linked Arch Linux

2012-10-25 Thread Strake
On 25/10/2012, Strake  wrote:
> Packages: http://strake.zanity.net:1104/starch/pkg/(core, extra)
> Build Scripts: http://strake.zanity.net:1104/starch/ports.git

Someone just told me that my server is unreachable. I thought I had it
working again, but clearly I was wrong. Sorry about this; I'll try to
unbreak it or find an alternative soon.

Cheers,
Strake



Re: [dev] [announce] Starch Linux: static-linked Arch Linux

2012-10-25 Thread Strake
On 25/10/2012, Calvin Morrison  wrote:
> Excellent work.
>
> Carry on good lad

Thanks, I mean to (^_^)



Re: [dev] [announce] Starch Linux: static-linked Arch Linux

2012-10-25 Thread Strake
On 25/10/2012, Calvin Morrison  wrote:
> You're sticking with initscripts I presume?

Yes.



[dev] [announce] Starch Linux: static-linked Arch Linux

2012-10-25 Thread Strake
Starch is a static-linked, Arch-based, highly experimental Linux
distro. I thought that some folks here may care to try it.

Packages: http://strake.zanity.net:1104/starch/pkg/(core, extra)
Build Scripts: http://strake.zanity.net:1104/starch/ports.git

To install, one can just use the stock Arch image and point pacman to
the Starch repo.

So far, the base system works and is bootable, on my qemu VM at least.
Binaries are linked against uClibc or musl; I hope to use musl alone
in near future.
It can't yet build itself, but has a toolchain available, taken from
sabotage, which links against musl.

Packages are built for amd64. I may add legacy x86_32 packages if
someone builds them, and I mean to add loongson packages when I get
one.

Short-term goals:
* Switch to musl
* Build self as host
* Find a mirror

Longer-term goals:
* Trash GNU gcc, binutils, bash
* Ergo, port all scripts to mksh
* Install media

Forever goals:
* Not lose

Cheers,
Strake



Re: [dev] Wayland

2012-10-23 Thread Strake
On 23/10/2012, Hugues Moretto-Viry  wrote:
> What do you think about Wayland?

Guess: http://wayland.freedesktop.org/docs/html/chap-Protocol.html



Re: [dev] [surf] [patch] Multiple views, one process

2012-10-19 Thread Strake
On 19/10/2012, Calvin Morrison  wrote:
> I think the largest benefit is the cache. Loading up many
> http://google.com's would mean you'd have to reload all of the images
> and such, whereas with one process, you wouldn't have an opportunity
> of overlap cache.

So make a local HTTP caching proxy.

Alternatively, to save memory perhaps, one could use local shared
cache files, e.g. /var/cache/surf/

> for unix-tooly-ness with kill, you could intercept signals and only
> have them apply to the current window.

So to kill some window, I must first switch to it, then kill it. Not
so bothersome interactively, but quite difficult in a script.

That, and KILL is uncatchable, so it would kill them all; same for STOP.



Re: [dev] uriel is gone

2012-10-14 Thread Strake
On 14/10/2012, Kurt H Maier  wrote:
> Sorry to have to let you guys know, uriel passed away peacefully a
> couple days ago.  We'll miss him.
>
> Kurt
>

I am very sorry to hear this. I never knew him in person, but I shall
miss his keen commentary.

Strake



[dev] [sbase/grep] [PATCH]: add z flag to use NULL separators

2012-10-07 Thread Strake
Not sure which would be better choice of flag: 'z' or '0', so I
arbitrarily chose 'z'.

commit 474a73ae118e6791fc56e616233dd9ccb5c8e92f
Author: strake 
Date:   Thu Oct 4 19:50:23 2012 -0500

grep: add z flag to use NULL separators

diff --git a/grep.c b/grep.c
index 9716328..48a54c0 100644
--- a/grep.c
+++ b/grep.c
@@ -18,6 +18,8 @@ static bool many;
 static bool match = false;
 static char mode = 0;

+static char delim = '\n';
+
 int
 main(int argc, char *argv[])
 {
@@ -41,6 +43,9 @@ main(int argc, char *argv[])
case 'v':
vflag = true;
break;
+   case 'z':
+   delim = '\0';
+   break;
default:
usage();
} ARGEND;
@@ -73,7 +78,7 @@ grep(FILE *fp, const char *str, regex_t *preg)
long n, c = 0;
size_t size = 0, len;

-   for(n = 1; afgets(&buf, &size, fp); n++) {
+   for(n = 1; getdelim(&buf, &size, delim, fp) >= 0; n++) {
if(buf[(len = strlen(buf))-1] == '\n')
buf[--len] = '\0';
if(regexec(preg, buf, 0, NULL, 0) ^ vflag)
@@ -92,7 +97,7 @@ grep(FILE *fp, const char *str, regex_t *preg)
printf("%s:", str);
if(mode == 'n')
printf("%ld:", n);
-   printf("%s\n", buf);
+   printf("%s%c", buf, delim);
break;
}
match = true;



Re: [dev] Hall of shame of the web

2012-09-29 Thread Strake
On 29/09/2012, Christoph Lohmann <2...@r-36.net> wrote:
> What  would you think about some kind of hall of shame for websites that 
> waste most resources?

"meh"



Re: [dev] libixp questions

2012-09-21 Thread Strake
On 21/09/2012, hiro <23h...@gmail.com> wrote:
> if you want reliability don't use a computer.
>

if you want reliability don't use the world.



Re: [dev] [st] Patches

2012-09-19 Thread Strake
On 19/09/2012, Roberto E. Vargas Caballero  wrote:
> Maybe a good solution could be
> integrate tmux inside of st (for example if STTMUX is defined, run tmux in
> starup).

Yeah! Oh, we could have a variable for everything that one could wish
to start in st: STTMUX, STGNUSCREEN, STAALIBKDE...

or we could just use -e.



  1   2   >