Re: Deprecated current-milliseconds

2023-12-07 Thread Vasilij Schneidermann
Hello,

the openssl egg does no longer produce the warning in version 2.2.5 by either 
importing the new or old identifier, depending on whichever is available. Feel 
free to use that approach in the other egg and consider that it may skew the 
grep results.

Vasilij

On December 7, 2023 12:21:12 PM GMT+01:00, Lassi Kortela  wrote:
>> chicken time current-process-milliseconds
>
>Thanks. Here's a grep of current-milliseconds in eggs-5-latest. Anybody got 
>time to patch some?
>
>dbus/0.97/tests/run.scm
>gochan/5.2.10/chibi-compat.scm
>gochan/5.2.10/chicken-module5.scm
>gochan/5.2.10/gochan-record-printer.scm
>gochan/5.2.10/gochan.scm
>gochan/5.2.10/readme.md
>gochan/5.2.10/tests/fake-search.scm
>gochan/5.2.10/tests/run.scm
>gochan/5.2.10/tests/stress.scm
>hopefully/0.2.6/tests/run.scm
>http-session/2.10/http-session.scm
>matchable/1.1/matchable-test.scm
>matrico/0.5rel/matrico.scm
>nrepl/5.0.8/readme.md
>openssl/2.2.5/openssl.socket.scm
>pigeon-hole/0.2.8/tests/run.scm
>postgresql/4.1.4/postgresql.scm
>r7rs/1.0.9/scheme.time.scm
>salmonella-feeds/0.1.1/salmonella-feeds.scm
>sendfile/1.11/sendfile.scm
>sendfile/1.11/strategies/mmap.scm
>sendfile/1.11/strategies/rw.scm
>simple-timer/0.1.2/timeout.scm
>socket/0.3.3/socket.scm
>sqlite3pth/0.2.6/sqlite3pth.scm
>srfi-18/0.1.7/srfi-18.scm
>srfi-18/0.1.7/tests/mutex-test.scm
>srfi-19/4.9.5/srfi-19-tm.scm
>test/1.2/test-support.scm
>



Re: Need GUI (again), gauging interest in an alternative approach.

2023-03-23 Thread Vasilij Schneidermann
Hello Matt,

> But, here we are, over 10 years later and IUP is still not available
> as an official Debian package and it is a burden to deploy. It is also
> still not supported on Mac.

The last I've heard on the topic was that the project has support for
the latest Ubuntu rather than Debian, but yes, this is a bad situation.

> NOTE: If hypergiant had a widget library with a decent text widget
> (line wrapping, copy/paste to the OS etc.) I'd have considered it.
> Raylib was also interesting and it's text support might have been
> adequate but the egg was never published and seems abandoned.

I've done some GUI work before and published a few eggs. The kiwi egg
does provide GUI widgets for use with SDL2. They are so-so in terms of
quality, but the source code is relatively simple to study. If your game
needs are simple, then you might get away with using or porting it.

One other alternative I've investigated specifically for use with
multimedia demos is nuklear. It implements an immediate mode GUI (IMGUI)
in form of a huge header file and requires the user to hook it up with
their toolkit and event loop. There are existing examples for using it
with SDL2 and such. I made an egg for C4 (the C5 port has been stalled
for silly reasons).

The IMGUI concept itself is simple and interesting enough to explore in
Scheme rather than C. Dear Imgui provides a more advanced version using
C++ and there is a tutorial by Casey Muratori for implementing your own.
I also recall Christian Kellermann to have implemented similar widgets
using that tutorial.

Vasilij


signature.asc
Description: PGP signature


Re: ldap-bind egg

2022-09-30 Thread Vasilij Schneidermann
Hello Sven,

> In a Scheme application, I have to authenticate users against an LDAP server
> (the server is from Microsoft).
> 
> Is the ldap-bind egg ( https://wiki.call-cc.org/eggref/4/ldap-bind )
> a good match for this task?

I'm afraid you'll have to try and see whether it works. My AD knowledge
is rudimentary, but I've seen several LDAP tools successfully used in AD
environments to query the network for membership. Since AD is
Microsoft-specific extensions to LDAP (and other open protocols), you
may need to jump through extra hoops, such as escaping forward slashes
in DNs: .

> If so, is there a chance that it will be ported from Chicken-4 to Chicken-5?

I've Cc'd the current maintainer of the egg. In case it's dormant,
porting and taking over its maintenance shouldn't be too hard due to the
low complexity of the code.

Vasilij


signature.asc
Description: PGP signature


Re: http-client egg and authentication

2022-09-29 Thread Vasilij Schneidermann
> Instead, you'd have to pass in an intarweb request object instead of an
> URI, and construct the Authorization header yourself.

Code:

(import (chicken base))
(import (chicken io))
(import http-client)
(import intarweb)
(import uri-common)

(define url "http://localhost:12345;)
(define user "myuser")
(define pass "mypass")

(let* ((authorization-header `(authorization #(basic ((username . ,user)
  (password .  
,pass)
   (request (make-request uri: (uri-reference url)
  headers: (headers (list 
authorization-header)
  (with-input-from-request request #f read-string))

Request:

GET / HTTP/1.1
Authorization: Basic bXl1c2VyOm15cGFzcw==
Host: localhost:12345
User-Agent: http-client/1.2 (CHICKEN Scheme HTTP-client)


signature.asc
Description: PGP signature


Re: http-client egg and authentication

2022-09-25 Thread Vasilij Schneidermann
Hello Christian,

I've experimented by setting up a listener with `nc -nlvp 12345` and
firing requests against localhost:12345

curl:

GET / HTTP/1.1
Host: localhost:12345
Authorization: Basic bXl1c2VyOm15cGFzcw==
User-Agent: curl/7.85.0
Accept: */*

http-client: 

GET / HTTP/1.1
Host: localhost:12345
User-Agent: http-client/1.2 (CHICKEN Scheme HTTP-client)

This confirms what you've seen. However, if you look at the
documentation of `determine-username/password`, the following jumps at
me:

> The procedure in this parameter is called whenever the remote host
> requests authentication via a 401 Unauthorized response.

Since the listener does not request authentication, the procedure is
never invoked. If you want to unconditionally set this header, pass it
explicitly.

Vasilij


signature.asc
Description: PGP signature


Re: utf8 printing problem

2022-07-23 Thread Vasilij Schneidermann
Hello Mátyás,

> Yep, you were right. It indeed had to do with the code page that the
> Windows command prompt uses by default which is code page 437. And the
> reason why the equivalent C# program worked, is because when it executes it
> automatically changes the code page of the terminal to utf-8 which is code
> page 65001. After that, if I execute the chicken test, it works perfectly.
> So now I learned something.

the output suggests you're using the MinGW version of CHICKEN. If you
have a full MinGW-MSYS2 setup, I recommend trying out their Mintty
terminal emulator, rather than cmd.exe. That might resolve UTF-8 issues.

Vasilij


signature.asc
Description: PGP signature


Re: How to do formatting in iup textbox?

2022-02-03 Thread Vasilij Schneidermann
Hello Matt,

> What is the equivalent to iup.user in the Chicken iup egg?

The egg doesn't have a binding for "IupUser", so you'd need to expose
that first.

> Or more generally, how to apply formatting to text in the textbox widget?

Should be a manner of using `attribute-set!` on the widget.

Vasilij


signature.asc
Description: PGP signature


Re: Help with egg definitions

2021-12-20 Thread Vasilij Schneidermann
Hello Robert,

> I'm trying to figure out how to create the egg definition for a program
> with multiple compilation units. Could someone link me to an example of
> such a definition, or somehow help me with this?

From what I can tell, eggs merely allow you to split a project into
several extensions, not units. If you're fine with that, you can
organize it appropriately and have a program depend on individual
extensions.

Alternatively consider using csm: https://wiki.call-cc.org/eggref/5/csm

Vasilij


signature.asc
Description: PGP signature


Re: Synch egg Missing import

2021-11-30 Thread Vasilij Schneidermann
Hello Jeff,

> I have some automated chicken builds that install some select eggs, and I'm
> starting to see errors when building the "synch" egg.  It complains about
> the undefined module "synch-object".  I replicated this on a fresh install
> of Ubuntu 20.10 with chicken 5.2.0 installed from apt, chicken-install sync
> fails with the same error.

This seems to be something specific to version 3.3.5 of the synch egg.
Try the following patch. I've Cc'd the egg author as well.

Vasilij
From 81071972de872de9de7318b02e47b6033d203d4a Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann 
Date: Tue, 30 Nov 2021 19:58:16 +0100
Subject: [PATCH] Add missing component dependencies

---
 synch/3.3.5/synch.egg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/synch/3.3.5/synch.egg b/synch/3.3.5/synch.egg
index 4b151a4..3917189 100644
--- a/synch/3.3.5/synch.egg
+++ b/synch/3.3.5/synch.egg
@@ -21,6 +21,7 @@
 (csc-options "-O3" "-d1" "-strict-types" 
"-no-procedure-checks-for-toplevel-bindings") )
   (extension synch-open
 (types-file)
+(component-dependencies synch-object)
 (csc-options "-O3" "-d1" "-strict-types" "-no-argc-checks" 
"-no-bound-checks" "-no-procedure-checks") )
   (extension synch-dynexn
 (types-file)
-- 
2.33.1



signature.asc
Description: PGP signature


Re: Windows vs Linux Performance, windows host 4-6x slower than linux guest vm

2021-09-06 Thread Vasilij Schneidermann
Hello Mark,

> You'll have to bear with me here, as I haven't tried adding profiling
> before.
> 
> I think I've got it done, but it only outputs at the function level, and
> the profile between the two platforms just seems to mirror a general
> difference in being slower on one platform.

The compilation options enable instrumentation-based profiling. There's
statistical profiling available when running executables with -:p which
might give you more useful data (see
https://www.more-magic.net/posts/statistical-profiling.html for more
infomation). Could you please try that one as well?

Vasilij


signature.asc
Description: PGP signature


New eggs: srfi-203 and srfi-216 (SICP)

2021-07-27 Thread Vasilij Schneidermann
Hello,

Someone on the IRC channel pointed out that there is no obvious egg to
use for solving SICP exercises as the sicp egg is C4-only and no
alternatives exist. I chose to port SRFI-203 and SRFI-216 which provide
the picture language and other SICP prerequisites.

Both eggs have been tested successfully with `test-new-egg`. I plan to
set up a C5 page for the sicp egg pointing to the two SRFIs instead.

https://depp.brause.cc/srfi-203/srfi-203.release-info
https://depp.brause.cc/srfi-216/srfi-216.release-info

Vasilij


signature.asc
Description: PGP signature


openssl: 2.2.4 release

2021-07-27 Thread Vasilij Schneidermann
Hello,

I've released openssl 2.2.4 to resolve an issue in the `file-cipher` and
`file-digest` procedures returning incorrect results for file sizes
that are not an exact multiple of 4096. I have to thank elflng for
finding the issue and megane with root cause analysis. As a result of
this, the `cipher-context-update!` and `digest-context-update!`
procedures have been amended to accept an optional `effective-length`
argument to read in less than the full blob.

If anyone else is using or considers using the `file-cipher` and
`file-digest` procedures, I strongly urge them to update to avoid
inconsistencies.

Vasilij


signature.asc
Description: PGP signature


openssl: 2.2.1 release

2021-07-05 Thread Vasilij Schneidermann
Hello,

What started out as a quest to fix compilation warnings in the openssl
egg, ended with a few more user-visible changes than that:

- The minimum OpenSSL version has been bumped to 1.1.0 to avoid the
  deprecated server/client version APIs. These have been replaced with a
  single API call to set both the minimum and maximum supported protocol
  version. Therefore it's now possible to accept a TLS version range,
  such as from TLSv1.0 up to TLSv1.2.
- TLSv1.3 support is detected and exposed at runtime.
- The `supported-ssl-protocols`, `ssl-min-protocol` and
  `ssl-max-protocol` allow testing supported protocol versions at runtime.
- The `openssl` module has been internally renamed to `(openssl
  socket)`, but is reexported under its old name for compatibility
  reasons. I intend to drop that alias whenever C6 happens.
- The `(openssl cipher)`, `(openssl digest)`, `(openssl random)` and
  `(openssl version)` modules have been introduced. The `(openssl
  cipher)` and `(openssl digest)` modules expose both low- and
  high-level procedures to work with ciphers and message digests. The
  `(openssl random)` module provides access to a CSPRNG. The `(openssl
  version)` module allows testing for the OpenSSL version and
  configuration.
- Examples have been added for the `(openssl cipher)`, `(openssl
  digest)` and `(openssl socket)` modules.
- A test suite covering all modules has been introduced and contains
  further module usage examples.

It's not all roses though. The OpenSSL APIs are historically grown and
not always easy to use. I've tried to avoid exposing as many footguns as
possible, but I'm certain that there's more work to do in this regard.
Please let me know if any of you run into troubles.

Further work ahead:

- OpenSSL 3 compatibility: I'll work on this whenever a stable release
  has been made available on Arch Linux. Resolving the compilation
  warnings made this task easier, but I expect new compilation warnings
  to appear.
- Exposing additional APIs. Candidates:
  - Hex encoding/decoding: Dubious utility (the task has been solved
well enough by other eggs, hex encoding uses colon separator,
decoding fails on empty buffer).
  - Base64 encoding/decoding: Dubious utility (there is a fast enough
base64 egg, encoding uses newlines, decoding fails on empty buffer).
  - Certificate handling: Messy APIs.
  - Asymmetric cryptography: Messy APIs.
  - Password derivation: Messy APIs intertwined with asymmetric
cryptography.
  - HMAC: Unsure if enough benefit.
  - Bignum: Unsure if enough benefit (might be worth it for number
theory procedures).
  - Other APIs: Please let me know about any worth exposing.

Some of the above issues have been resolved by OpenSSL 3, but would need
to be implemented in Terms of OpenSSL 1.1.0. Perhaps it would make more
sense to write a binding to Botan instead...

Vasilij


signature.asc
Description: PGP signature


Re: Actor model implementation, seeking feedback

2021-07-04 Thread Vasilij Schneidermann
> That might just work. A UUIDv4 is 128 bits, so it can be plugged in
> wherever 128 bits of nonce are required. However this isn't always the
> case, for example AES-GCM is commonly used with 96 bit nonces. Another
> thing to consider is that the egg provides UUID4. UUID1 might be smarter
> for a distributed setting as it has a machine-specific part.

I've looked at the egg source and found it takes the output of
`random-bytes` from `(chicken random)` and formats it. So one might as
well use `random-bytes` directly. The UUID1 route might still be worth
exploring.

Vasilij


signature.asc
Description: PGP signature


Re: Actor model implementation, seeking feedback

2021-07-04 Thread Vasilij Schneidermann
Hello Mario,

> Would http://wiki.call-cc.org/eggref/5/uuid be suitable for the casae in
> question?

That might just work. A UUIDv4 is 128 bits, so it can be plugged in
wherever 128 bits of nonce are required. However this isn't always the
case, for example AES-GCM is commonly used with 96 bit nonces. Another
thing to consider is that the egg provides UUID4. UUID1 might be smarter
for a distributed setting as it has a machine-specific part.

Vasilij


signature.asc
Description: PGP signature


Re: Egg: ws-client

2021-07-04 Thread Vasilij Schneidermann
Hello Ka-tsùn,

> - This implementation passes all of the Autobahn compliance tests.
> I've included the client and configuration file in an examples/
> directory, but the repository currently has no tests/ because the
> Autobahn tests are usually run from a docker image and take a while to
> finish.

I don't know much about websockets at all, but would it be possible to
at least include a smoke test or sanity check? There are a few eggs
(json-rpc, srfi-18, fuse, gochan, sendfile, spiffy) that spawn a server
process with process-fork, send a request to it and check whether it was
successful. There's even the server-test egg dedicated for this purpose.

> - permessage-deflate presently interfaces with the C zlib directly,
> because we use options for the stream interface that the zlib egg
> doesn't currently expose. This results in some repeated code.

I've hacked on that egg recently and discovered that the author wanted
to expose deflateInit2 and inflateInit2 for a while, so I helped review
their code and they released a new version exposing MAX_WBITS. I've also
submitted a PR demonstrating how this can be used to handle raw deflate,
zlib and gzip data: . Perhaps this
is of use.

> - I am relatively new to the language, so I would be extremely
> grateful if anyone would like to take a look at the source & provide
> some feedback! I fear silly mistakes, and also suspect much of the
> code might be made more idiomatic for Scheme.

The code looks fine to me. There's small improvements that can be made
to improve readability:

- `(make-composite-condition (make-property-condition ...) ...)` can be
  replaced with `(condition '(...) ...)`.
- `(case o ((...) #t) (else #f))` can be replaced with `(and (memv o
  '(...)) #t)`. It might not be equivalent in terms of generated code
  though.
- `(if condition consequent)` and `(if condition (begin consequent
  ...))` are equivalent to `(when condition consequent)` and `(when
  condition consequent ...)`.
- The `foreign-lambda*` using memcpy might be replacable with a call to
  `move-memory!` from `(chicken memory)`.

Vasilij


signature.asc
Description: PGP signature


Re: Compiling Chicken app for Windows from linux with Docker

2021-06-27 Thread Vasilij Schneidermann
Hello Théo,

> Using the cross development article on the wiki, digging through the build
> system a bit and fiddling a lot I created a MinGW-w64 based environment that
> let you build standalone apps from your chicken code and your favorite eggs
> that can be distributed as a single binary without needing dev oriented
> dependencies like cygwin or MSYS2.

That does sound interesting, though I'm not sure whether this won't be
an issue later on for foreign dependencies.

> Here is an image ready to go (because compiling chicken twice is pretty
> long): https://hub.docker.com/repository/docker/lattay/chicken-mingw

That link redirects me to a login page.

> Currently my testing of this environment is pretty limited. I did a test
> with the args egg but I don't know how well it would perform with more
> complex eggs like bind based one.

I've done some manual testing in a MinGW64-msys2 environment and managed
to get most of my eggs to work. You can for example try to get the
breadline or taglib egg running as they only need readline/taglib
respectively.

> I don't have a non trivial app that would work on windows to test with this
> process.

I'd start with the trivial applications first. The gl-utils egg has some
examples that create graphical windows.

> Hence, I would be interested in some real world Windows ready app for this.

I have seen a few attempts at creating Windows-specific eggs, but so far
the only applications I've spotted were Kooda's games (which are
cross-compiled in a similar manner to your Docker setup). You can find
them here: 

My testing of egg installation under MinGW unveiled 94 errors, with
Cygwin being somewhat better off. I suspect the main problem is that
Scheme applications are CLI-only unless you somehow get GLFW3/SDL2/IUP
running and that is enough of a roadblock to deter all but the most
enthusiast users from spending more time with this Scheme system (and
instead use Racket's built-in cross-platform GUI or something else).

> Also, I have yet to understand what is the difference between console and
> GUI app in windows and how this environment could be used to build graphical
> apps.

Even a console application can make use of GLFW3 to launch a graphical
window to perform OpenGL drawing in, so the distinction is rather
technical: 

Vasilij


signature.asc
Description: PGP signature


Re: Actor model implementation, seeking feedback

2021-06-26 Thread Vasilij Schneidermann
Hello John,

> *Any* numeric sequence will repeat eventually unless it grows without
> bound, like a TAI timestamp.

I take "repeats after exceeding 2^n consecutive numbers" over "repeats
with a 1/2^n chance" (which can be generalized to 2^(n/2) thanks to the
birthday problem).

> But actually it's not enough that a nonce be unique, otherwise 1, 2,
> 3, ... would be a perfectly good sequence of nonces.

That is what a counter with a sequence of NUL bytes would produce. It's
perfectly fine. As long as the sequence is not reused.

> So you do want a long-period cryptographically strong random sequence
> like ChaCha20 or Fortuna, or it will be possible to predict the next
> nonce from the previous nonces.

Why would predicting the next nonce matter? You cannot do anything
useful with that knowledge. The nonce exists to perturb stream cipher
operations so that the combination of same message, same key and nonce
does not lead to the same ciphertext.

Vasilij


signature.asc
Description: PGP signature


Re: Actor model implementation, seeking feedback

2021-06-26 Thread Vasilij Schneidermann
Hello Ariela,

> 2. You're right! I actually hadn't thought about that! Guess I had a hard time
> not conflating "unique and non-repeatable" with random numbers... would a
> timestamp be a better (but probably still not ideal) approach?

No, timestamps may repeat if taken quickly enough. Another issue is that
in a distributed system you must now guarantee that all participants
have synchronized clocks...

A particularly elegant approach is to generate random bytes once (much
like a secret key is generated once), then increment them for each
consecutive encryption operation (much like the CTR mode works). For
example RFC7523 uses the following nonces in appendix A:

BBAA99887766554433221100
BBAA99887766554433221101
BBAA99887766554433221102
...
BBAA9988776655443322110F

Vasilij


signature.asc
Description: PGP signature


Re: Actor model implementation, seeking feedback

2021-06-26 Thread Vasilij Schneidermann
Hello Ariela,

> But that's just my opinion, so I'd like to hear some feedback about it before 
> I
> decide if it's worth submitting to the coop now, or ever.
> 
> The project uses nng[1] for communication (I made some rudimentary bindings to
> the bare minimum), protobuf for serialization and tweetnacl for encryption.
> Now, I'm FAR from an expert on communication, security, or even concurrency,
> so there's probably a lot to pick on :)

0. Funny how history repeats itself with the actor model and Scheme:


1. Why Protobuf? Why in combination with JSON? Why not just JSON? Or
just Protobuf, but consider it's been designed for the cases where JSON
is too expensive to use, so not for this project I guess...

2. Cool that you use tweetnacl for encryption, but please don't use
random numbers for nonces, that's just wrong. Nonces are not supposed to
be secret, random or unpredictable, but unique numbers that do not
repeat. Random numbers do repeat eventually. If a nonce repeats, this
allows certain cryptographical attacks to be performed on the
corresponding ciphertexts.

Vasilij


signature.asc
Description: PGP signature


Re: chicken-install not working on windows

2021-06-02 Thread Vasilij Schneidermann
Hello Jeremy,

> Someone on reddit pointed out that I should've used msys to install it
> (I got a windows installer for the web which turned out to be an older
> version of chicken).

Yes, I've commented in that thread.

> PS C:\Users\user> chicken-install -s apropos chicken-doc

Don't use Powershell. Use the MinGW shell. I already wrote that on
Reddit. While programs compiled with MinGW may work outside of it,
you're supposed to use the MinGW toolchain for development.


signature.asc
Description: PGP signature


Re: Request for review

2021-05-14 Thread Vasilij Schneidermann
Hello Arnaud,

> I have started a small project whose purpose is to simulate Darwin's
> theory and I would really appreciate some code review from more
> experienced scheme developers, esp. when it comes to structuring,
> idiomatic code patterns, egg definitions...

I'd generally recommend studying Riastradh's style guide [1]_. That
aside:

- Stick closing parentheses together.
- No need to use begin in let and let*, it's doing an implicit begin.
- Why bind variables with let, then immediately set! them? For
  side-effectful values I'd just use let* with the corresponding
  expression.
- print takes several arguments, so no need to string-append them.
- Consider doing some basic encapsulation by writing
  constructor/accessor procedures, that makes swapping out the
  implementation a lot easier. SICP has a bunch of things to say on the
  topic.

[1]: https://mumble.net/~campbell/scheme/style.txt


signature.asc
Description: PGP signature


New egg: gtk-server

2021-05-12 Thread Vasilij Schneidermann
Hello everyone,

The coding jam inspired me to look into GUI eggs again. I found a
GTK-server [1]_ demo by Felix from 2005 [2]_, turned it into a
gtk-server egg and ported all bundled examples. It may very well be the
most advanced (though not the most pleasant) option to use for building
graphical user interfaces, as it exposes a "textual FFI" to GTK and
related libraries (such as GDK, Cairo, Poppler, Webkit and more). The
only prerequisite is a `gtk-server` binary on your system. It took me
longer to package GTK-server for my system than writing the egg. I still
plan to look into other libraries for simpler and more fun approaches
(such as ezd and nuklear).

The documentation and release-info file are at
 and
. Both
`salmonella` and `test-new-egg` pass.

Vasilij

[1]: http://gtk-server.org/
[2]: http://gtk-server.org/demo-stdin.scm.txt


signature.asc
Description: PGP signature


Re: "Live coding" on Mac OS X

2021-05-11 Thread Vasilij Schneidermann
Hello Arnaud,

> But it's not working properly: What I observe is that when I change a
> procedure that's called from the background thread, the thread becomes
> blocked. Is this some new behaviour that's not taken into account in
> those posts?

It's tricky to reproduce such issues without a minimal repro. I wrote my
own and I do not experience such behavior. When I run the attached file
with `csi -:x test.scm`, I see it printing 1 every 10s. I can then
copy-paste `(define (game-loop-iteration) (print 2))` into the REPL and
if I wait another 10 seconds, it prints 2. Do you have the same
behavior? If yes, then chances are it's the fault of the code change
(for example it might perform a thread blocking operation).

> $ csi -version
> CHICKEN
> (c) 2008-2020, The CHICKEN Team
> (c) 2000-2007, Felix L. Winkelmann
> Version 5.2.0 (rev 317468e4)
> macosx-unix-clang-x86-64 [ 64bit dload ptables ]
> 
> I am on Mac OS X Catalina 10.15.7.

I'm on the same CHICKEN version, but on Arch Linux.

Vasilij
(import scheme)
(import (chicken base))
(import (srfi 18))

(define (game-loop-iteration)
  (print 1))

(define (main)
  (let loop ()
(game-loop-iteration)
(thread-sleep! 10)
(loop)))

(define game-thread (thread-start! main))

(cond-expand
 ((or chicken-script compiling)
  (thread-join! game-thread))
 (else))

(cond-expand
 (csi (import live-define))
 (else))

#;
(when (eqv? 'terminated (thread-state game-thread))
  (set! game-thread (thread-start! main)))


signature.asc
Description: PGP signature


Re: Chicken GUI options survey and questions.

2021-03-05 Thread Vasilij Schneidermann
Hello Matt,

> What is your preferred toolkit for making GUI apps with chicken? 

I've spent a few months evaluating the existing options for C4 and
making a few myself. From the existing options pstk was the only one
worth using as it has been around the longest and solves the common GUI
problems you'd run into. Consider whether a design like ma [1] would
work for you (written in Tcl, interfaces with Scheme via IPC) and make
sure to look at bintracker [2].

I contributed the kiwi, libui and nuklear eggs to the C4 coop. kiwi is a
toy (it's interesting to study though), libui is nowhere near done,
nuklear however is refreshing to use. Weren't it for the lack of
documentation I'd fully recommend it for multimedia applications (such
as inside a SDL2 game or application). There is some extra work to be
done for a C5 port, such as figuring out how to package it with regards
to backends (some backends are platform-specific and it's unclear
whether to use auto-detection, allow users to pick them at installation
time or splitting them into many eggs) and looking into changes made
since then (it seems to have gained actual documentation).

> Alternatives to consider
> 
> 
>  * webview egg
>  * qt-light 
>  * pstk (probably not really an option, ancient look/feel).
>  * kiwi (probably too limited for my needs)

I've used both the webkit (C4) and webview (C5) eggs for a simple ebook
reader application [3]. You may find its source code useful to determine
whether it will do the trick for whatever you've had in mind. They're
attractive for simple tasks, but as soon as you need access to native
resources, you'll run into security/usability issues (SOP and caching
are a deadly combination) and might have to write code you didn't plan
to, such as a web server offering ressources/RPC. qt-light covers very
little ground overall, so I'd dismiss it for the same reasons as kiwi.
See above for my thoughts on pstk, bintracker shows that the stock
appearance can be changed with some effort.

> Others
> --
> 
> nuklear http://wiki.call-cc.org/eggref/4/nuklear,
> https://github.com/Immediate-Mode-UI/Nuklear
> looks interesting, not clear if actively supported

I'll work on it some day, perhaps earlier if I find someone else to
figure out the packaging and update parts :>

> flutter - no egg yet but checks all modern gui boxes and
>   highly portable. Comments on effort required to 
>   make a binding to Chicken would be appreciated.
>   BTW: No, I'm not interested in developing in dart.
>   I'm sure it is a great language but I like Chicken.

I haven't looked much into it, but it seems to be firmly locked into the
Dart ecosystem. One way or the other, you'll end up writing Dart code to
use it. I remember someone on the #chicken channel announcing to look
into DOtherSide [4], that would give you Qt/QML at the expense of having
to write programming logic in something resembling JavaScript.

[1]: http://www.call-with-current-continuation.org/ma/ma.html
[2]: https://bintracker.org/
[3]: https://depp.brause.cc/teapub/
[4]: https://github.com/filcuc/DOtherSide


signature.asc
Description: PGP signature


Re: Source code formatter?

2021-01-11 Thread Vasilij Schneidermann
Hi Paul,

Evan Hanson wrote one: https://git.foldling.org/schematic/

I don't use source code formatters though, Emacs does the indentation
parts far better than anything else, leaving strategic placement of line
breaks to the programmer.

Vasilij


signature.asc
Description: PGP signature


Re: Updating yaml egg from Chicken 4 to Chicken 5?

2020-12-30 Thread Vasilij Schneidermann
> I'd like to see this as a Chicken 5 egg.  What is the proper way,
> considering the social and technical aspects of things, to getting this
> submitted as a Chicken 5 egg?

I've received two emails about PRs I've handed in for C5 compatibility
being merged:

- https://github.com/tenderlove/chicken-yaml/pull/9#event-4158277799
- https://github.com/tenderlove/chicken-yaml/pull/10#event-4158267744

There's been commits after that as well. I've checked out master and ran
the C5 versions of `salmonella` and `test-new-egg` successfully there.
Therefore I'd advise not being hasty, the author might submit the egg
for C5 soonish and even if they don't end up doing so, just remind them
about it.

Vasilij


signature.asc
Description: PGP signature


Re: openssl patch

2020-12-02 Thread Vasilij Schneidermann
Hello Harley,

> Now the patch is actually small.

Thank you very much, I've tested the patch and made a 2.0.7 release. It
should appear in your nearest egg mirror soon.

Vasilij


signature.asc
Description: PGP signature


Re: openssl patch

2020-12-01 Thread Vasilij Schneidermann
Hello Harley,

> I've attached a small patch for the openssl egg that adds another error 
> status.

This isn't small due to what seems to be loads of whitespace changes.
Could you please fix those and resend the patch?

Vasilij


signature.asc
Description: PGP signature


Re: New C5 egg: SRFI-145: Assumptions

2020-11-09 Thread Vasilij Schneidermann
SRFI-146 is ready for inclusion as well:
https://depp.brause.cc/srfi-146/srfi-146.release-info

Vasilij


signature.asc
Description: PGP signature


Re: New C5 egg: SRFI-145: Assumptions

2020-11-09 Thread Vasilij Schneidermann
Hello Jeremy,

> If that's the case, should we deprecate / remove SRFI 121 from the coop?

SRFI-121 is only in the C4 coop and likewise SRFI-158 only in the C5
one, so I don't see any need for removal.  A deprecation notice could be
added for SRFI-121 to the C4 wiki page.   If you insist you could add a
stub C5 wiki page pointing out the existence of SRFI-158, much like it
was done with readline/breadline: https://wiki.call-cc.org/eggref/5/readline

Vasilij


signature.asc
Description: PGP signature


Re: New C5 egg: SRFI-145: Assumptions

2020-11-09 Thread Vasilij Schneidermann

Hello again,

SRFI-158 (Generators) is ready as well:
https://depp.brause.cc/srfi-158/srfi-158.release-info

Vasilij


signature.asc
Description: PGP signature


New C5 egg: SRFI-145: Assumptions

2020-11-09 Thread Vasilij Schneidermann
Hello everyone,

I've implemented SRFI-145 in terms of the existing assert macro.
`salmonella` and `test-new-egg` run fine with
.  A wiki page is
ready to be submitted after inclusion into the coop.

This egg is part of an effort to get SRFI-168 (Generic Tuple Store
Database) working.  I plan to port SRFI-158 (Generators), SRFI-146
(Mappings), SRFI-167 (Ordered Key Value Store) and the
persistent-hash-map egg (currently C4-only, with no customizable
hash/equality procedures), then to create an egg for a suitable
persistent ordered key-value store (for example the sophia database) and
another one for a compatible interface for use by SRFI-168.

Vasilij


signature.asc
Description: PGP signature


Re: Dead link on matchable documentation

2020-09-28 Thread Vasilij Schneidermann
Hello Matt,

> This link to this paper an-introduction-to-lispy-pattern-matching.html,
> from http://wiki.call-cc.org/eggref/5/matchable, is dead. I could not find
> the paper.

Thankfully it's a wiki anyone can edit, so I've updated the link to a
working archive.org version pointing to an old Racket page.

Vasilij


signature.asc
Description: PGP signature


Re: openssl static compile issue

2020-05-12 Thread Vasilij Schneidermann
Hello Peter,

I've experimented a bit and found it's a matter of shuffling the imports
around.  Here's an example:

(import scheme)
(import (chicken base))
(import (chicken io))
(import openssl) ; HACK: this must precede the http-client import
(import http-client)

(with-input-from-request "https://en.wikipedia.org/wiki/Cat; #f read-string)

Vasilij


signature.asc
Description: PGP signature


Re: choco : csc complains about "Error: default type-database `types.db' not found"

2020-04-01 Thread Vasilij Schneidermann
Hello Jo,

I can reproduce the issue with a fresh VM.  It appears that the chocolatey
package is completely broken as I cannot even do something as simple as
evaluating `(load (chicken io))` in a `csi` session, let alone compile files
(there is no C toolchain included in the dependencies).

Now, what you can do is a manual installation using the mingw64-msys2 package
installed as a dependency:

- Execute `mingw64` from a `cmd` session
- Execute the following commands in that window:

pacman -S mingw-w64-x86_64-toolchain make curl winpty
curl -LO https://code.call-cc.org/releases/5.2.0/chicken-5.2.0.tar.gz
tar -xf chicken-5.2.0.tar.gz
cd chicken-5.2.0
make PLATFORM=mingw-msys PREFIX=C:/tools/chicken-5.2.0
make PLATFORM=mingw-msys PREFIX=C:/tools/chicken-5.2.0 install
echo 'export PATH=/c/tools/chicken-5.2.0/bin:$PATH' >> ~/.bash_profile
export PATH=/c/tools/chicken-5.2.0/bin:$PATH

You can now execute `winpty csi` to spawn a `csi` session and compile Scheme
files with `csc`.

Vasilij


signature.asc
Description: PGP signature


Re: CHICKEN 5.2.0 has been released

2020-03-06 Thread Vasilij Schneidermann
Hello Daniel,

> The sql-de-lite package has a small glitch.

This breaking change required adjustments in several eggs.  To our
knowledge all of them but sql-de-lite have been fixed by now.
Check out  for three
different ways to fix the issue.

Vasilij


signature.asc
Description: PGP signature


Re: Error: unbound variable: readline#make-readline-port

2020-03-02 Thread Vasilij Schneidermann
Hello Damien,

You'll want to `(use readline)` and `(use linenoise)` with CHICKEN 4.
While `(import readline)` can be used, its purpose is different as it
only loads bindings and doesn't load the shared library.  With CHICKEN 5
this behavior has been consolidated, you'd use `(import readline)` and
`(import linenoise)` there (assuming there was a readline egg).

Vasilij


signature.asc
Description: PGP signature


Re: [ANN] CHICKEN 5.2.0 release candidate 2 available

2020-02-19 Thread Vasilij Schneidermann
Hello,

Operating system: Windows 10 mingw64-msys2
Hardware platform: x86-64
C Compiler: gcc.exe (Rev2, Built by MSYS2 project) 9.2.0
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes, tested with breadline

Operating system: Debian 10
Hardware platform: x86-64
C Compiler: gcc (Debian 8.3.0-6) 8.3.0
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes, tested with breadline

Vasilij


signature.asc
Description: PGP signature


Re: [ANN] CHICKEN 5.2.0 release candidate available

2020-02-10 Thread Vasilij Schneidermann
Hello,

Operating system: Windows 10 mingw-msys2 under mingw64
Hardware platform: x86-64
C Compiler: gcc version 9.2.0 x86_64-w64-mingw32 (Rev2, Built by MSYS2 project)
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes, the installation of the sql-de-lite
egg fails with "the `-c' option cannot be used in combination with
multiple input files"

Vasilij


signature.asc
Description: PGP signature


Re: How to get a useful repl with Chicken 5?

2020-01-31 Thread Vasilij Schneidermann
Hello again,

> I'll try to reproduce the issue with Ubuntu 18.04 in a Docker container
> or something.

Turns out that for some forsaken reason Ubuntu does neither provide a
`readline.pc` nor uses a reasonable path for headers and libraries.
There are two ways of working around this, one is setting up a
`readline.pc` as described in
, the other one is to
pass the flags shown there via `READLINE_CFLAGS` and `READLINE_LDLIBS`
at installation time:

export READLINE_CFLAGS=-I/usr/include/readline
export READLINE_LDLIBS=-lreadline
chicken-install breadline

Vasilij


signature.asc
Description: PGP signature


Re: How to get a useful repl with Chicken 5?

2020-01-31 Thread Vasilij Schneidermann
Hello Matt,

> 4. Code completion works!! Maybe it is a bit much to ask but it'd be useful
> if completion rolled over from internal symbols to files. (*)

Fun fact: The default readline completer uses file names.  If you change
it to something else you no longer get file names.  Since the example
code did that to get Scheme completions, you'd need to extend it to
handle file names.  I don't think I'll reimplement it in Scheme, but it
should nevertheless be a good exercise.

> Thanks Vasilij, this egg is very much appreciated. If no one else is
> reporting problems on Ubuntu 18.04 then likely I've got something messed up
> on my home machine. I'll debug further and report back on what I find.

I'll try to reproduce the issue with Ubuntu 18.04 in a Docker container
or something.

Vasilij


signature.asc
Description: PGP signature


Re: How to get a useful repl with Chicken 5?

2020-01-30 Thread Vasilij Schneidermann
Hello Matt,

> I've read the docs on linenoise and breadline but I'm not seeing how to get
> a useful editable repl.
> 
> Any pointers or suggestions would be appreciated.

I've developed breadline.  Its wiki page has an examples section which
shows how to create a custom REPL for programs and points to
 for two
more examples, a `.csirc` (for your other scenario of customizing `csi`)
and how a simple completer can be created.

The story is similar with linenoise, its wiki page has an example
section for general use and a "Using linenoise in csi" one.  Did you
have issues with setting either up?

Vasilij


signature.asc
Description: PGP signature


Re: [ANN] CHICKEN 5.2.0 release candidate available

2020-01-14 Thread Vasilij Schneidermann
Hello,

Operating system: Windows 10 mingw-msys under mingw32
Hardware platform: x86
C Compiler: MinGW.org GCC-8.2.0-5
Installation works?: yes
Tests work?: no
Installation of eggs works?: yes

I've tried the `chicken-install pastiche` check, it fails as expected on 
sql-de-lite.

`make check` log:

C:\Users\schnev\Downloads\chicken-5.2.0rc1>make PLATFORM=mingw-msys 
PREFIX=C:/chicken/ check
cd tests; sh runtests.sh
 repository search path ...
(C:/chicken//lib/chicken/11)
(PASS) (repository-path) contains something by default
 TOTALS:
  1 tests completed in 0.029 seconds
  1 (100.00%) tests passed
  0 (0.00%) tests failed
"C:/Users/schnev/Downloads/chicken-5.2.0rc1/tests/../chicken 
"sample-module.scm" -output-file "sample-module.c" -dynamic -feature 
chicken-compile-shared -verbose -include-path 
C:/Users/schnev/Downloads/chicken-5.2.0rc1/tests/.. -consult-types-file 
../types.db -ignore-repository -emit-import-library sample-module"
generating import library `sample-module.import.scm' for module 
`sample-module' ...
""gcc" "sample-module.c" -o "sample-module.obj" -c  -fno-strict-aliasing 
-fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -DPIC -DC_SHARED 
-IC:/Users/schnev/Downloads/chicken-5.2.0rc1/tests/.. 
-IC:/chicken//include/chicken"
rm sample-module.c
""gcc" "sample-module.obj" -o "sample-module.so" -Wl,--enable-auto-import 
-shared -LC:/Users/schnev/Downloads/chicken-5.2.0rc1/tests/.. 
-LC:/Users/schnev/Downloads/chicken-5.2.0rc1/tests/.. -lchicken -lm -lws2_32"
rm sample-module.obj
(PASS) find-file on #f
(PASS) find-file on string
(PASS) find-file on list
(FAIL) (repository-path) is populated by CHICKEN_REPOSITORY_PATH: expected 
("C:/Users/schnev/Downloads/chicken-5.2.0rc1/tests/.." 
"C:/Users/schnev/Downloads/chicken-5.2.0rc1/tests/test-repository") but got 
("C:\\Users\\schnev\\Downloads\\chicken-5.2.0rc1\\" 
"C:\\Users\\schnev\\Downloads\\chicken-5.2.0rc1\\tests\\test-repository")
(PASS) setting (repository-path) and loading a library
(PASS) Putting garbage in (repository-path)
 TOTALS:
  6 tests completed in 0.051 seconds
  5 (83.33%) tests passed
  1 (16.66%) tests failed
make: *** [check] Error 1

Vasilij


signature.asc
Description: PGP signature


Re: Where to report doc errors?

2019-12-22 Thread Vasilij Schneidermann
Hello Iain,

If you already know what the correct link target should be, feel free to edit 
the wiki page by clicking the edit link and changing the relevant markup. 
Alternatively tell us on Freenode's #chicken channel, there's likely to be 
someone there who can help.



Re: [Chicken-users] Debian 9 amd64 chicken-bin 4.11.0-1 cannot import from undefined module process-context

2019-09-17 Thread Vasilij Schneidermann
Hey David,

You're using version 4 of the compiler, but version 5 of the documentation. You 
can tell the latter by looking for the number in the URL.

Vasilij___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

2019-07-22 Thread Vasilij Schneidermann
One more time, with a patch for Jim.
From 8db9d5d79e63e3a552e5ab2a8571d9deeb7fa8f3 Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann 
Date: Mon, 22 Jul 2019 22:49:30 +0200
Subject: [PATCH] C5 compatibility

---
 build-hostinfo |  2 ++
 build-hostinfo.bat |  2 ++
 hostinfo.egg   |  7 +++
 hostinfo.scm   | 22 --
 4 files changed, 27 insertions(+), 6 deletions(-)
 create mode 100755 build-hostinfo
 create mode 100644 build-hostinfo.bat
 create mode 100644 hostinfo.egg

diff --git a/build-hostinfo b/build-hostinfo
new file mode 100755
index 000..56c69a4
--- /dev/null
+++ b/build-hostinfo
@@ -0,0 +1,2 @@
+#!/bin/sh
+"$CHICKEN_CSC" -O2 -d2 -C "$CFLAGS" -L "$LDFLAGS" "$@"
diff --git a/build-hostinfo.bat b/build-hostinfo.bat
new file mode 100644
index 000..c882ab5
--- /dev/null
+++ b/build-hostinfo.bat
@@ -0,0 +1,2 @@
+@echo off
+%CHICKEN_CSC% -O2 -d2 -C %CFLAGS% -L -lws2_32 -L %LDFLAGS% %*
diff --git a/hostinfo.egg b/hostinfo.egg
new file mode 100644
index 000..f6fb52b
--- /dev/null
+++ b/hostinfo.egg
@@ -0,0 +1,7 @@
+;;; hostinfo.meta -*- Hen -*-
+((synopsis "Look up host, protocol, and service information")
+ (author "Jim Ursetto")
+ (dependencies foreigners system-information)
+ (license "BSD")
+ (category net)
+ (components (extension hostinfo (custom-build "build-hostinfo"
diff --git a/hostinfo.scm b/hostinfo.scm
index 7dfd0fc..7ede91a 100644
--- a/hostinfo.scm
+++ b/hostinfo.scm
@@ -60,8 +60,6 @@
 
 #> #include "hostinfo.h" <#
 
-(require-extension srfi-4 lolevel posix)
-
 (module hostinfo
 ;;; Short and sweet lookups
   (current-hostname
@@ -82,10 +80,22 @@
 ;;; Utilities
string->ip ip->string)
 
-  (import scheme chicken
-  extras srfi-4 lolevel posix foreign
- data-structures
-  foreigners)
+  (import scheme)
+
+  (cond-expand
+   (chicken-4
+(import chicken foreign)
+(require extras srfi-4 lolevel posix data-structures foreigners))
+   (chicken-5
+(import (chicken base))
+(import (chicken blob))
+(import (chicken fixnum))
+(import (chicken foreign))
+(import (chicken format))
+(import (chicken string))
+(import (srfi 4))
+(import foreigners)
+(import system-information)))
 
   (define (vector-map p v0)   ; to avoid linking in vector-lib
 (let* ((len (vector-length v0))
-- 
2.22.0



signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

2019-07-22 Thread Vasilij Schneidermann
For some reason putting Jim into Cc didn't work, so I'm trying it the
other way.  Once again, a patch for porting hostinfo to C5.

Vasilij
From 8db9d5d79e63e3a552e5ab2a8571d9deeb7fa8f3 Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann 
Date: Mon, 22 Jul 2019 22:49:30 +0200
Subject: [PATCH] C5 compatibility

---
 build-hostinfo |  2 ++
 build-hostinfo.bat |  2 ++
 hostinfo.egg   |  7 +++
 hostinfo.scm   | 22 --
 4 files changed, 27 insertions(+), 6 deletions(-)
 create mode 100755 build-hostinfo
 create mode 100644 build-hostinfo.bat
 create mode 100644 hostinfo.egg

diff --git a/build-hostinfo b/build-hostinfo
new file mode 100755
index 000..56c69a4
--- /dev/null
+++ b/build-hostinfo
@@ -0,0 +1,2 @@
+#!/bin/sh
+"$CHICKEN_CSC" -O2 -d2 -C "$CFLAGS" -L "$LDFLAGS" "$@"
diff --git a/build-hostinfo.bat b/build-hostinfo.bat
new file mode 100644
index 000..c882ab5
--- /dev/null
+++ b/build-hostinfo.bat
@@ -0,0 +1,2 @@
+@echo off
+%CHICKEN_CSC% -O2 -d2 -C %CFLAGS% -L -lws2_32 -L %LDFLAGS% %*
diff --git a/hostinfo.egg b/hostinfo.egg
new file mode 100644
index 000..f6fb52b
--- /dev/null
+++ b/hostinfo.egg
@@ -0,0 +1,7 @@
+;;; hostinfo.meta -*- Hen -*-
+((synopsis "Look up host, protocol, and service information")
+ (author "Jim Ursetto")
+ (dependencies foreigners system-information)
+ (license "BSD")
+ (category net)
+ (components (extension hostinfo (custom-build "build-hostinfo"
diff --git a/hostinfo.scm b/hostinfo.scm
index 7dfd0fc..7ede91a 100644
--- a/hostinfo.scm
+++ b/hostinfo.scm
@@ -60,8 +60,6 @@
 
 #> #include "hostinfo.h" <#
 
-(require-extension srfi-4 lolevel posix)
-
 (module hostinfo
 ;;; Short and sweet lookups
   (current-hostname
@@ -82,10 +80,22 @@
 ;;; Utilities
string->ip ip->string)
 
-  (import scheme chicken
-  extras srfi-4 lolevel posix foreign
- data-structures
-  foreigners)
+  (import scheme)
+
+  (cond-expand
+   (chicken-4
+(import chicken foreign)
+(require extras srfi-4 lolevel posix data-structures foreigners))
+   (chicken-5
+(import (chicken base))
+(import (chicken blob))
+(import (chicken fixnum))
+(import (chicken foreign))
+(import (chicken format))
+(import (chicken string))
+(import (srfi 4))
+(import foreigners)
+(import system-information)))
 
   (define (vector-map p v0)   ; to avoid linking in vector-lib
 (let* ((len (vector-length v0))
-- 
2.22.0



signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

2019-07-22 Thread Vasilij Schneidermann
Hello Matt,

Turns out this wasn't that hard to port.  I've added Jim to Cc so that
he can take a look at the patch.

Unfortunately I don't know much about this networking thing, so I can't
help you with the bug, other than giving you debugging ideas.  Take a
look at how exactly the egg performs its lookups and compare it with
your own solution.  Maybe there's a crucial thing missing in the egg or
something.  Another thing that would help would be having a publicly
reachable host at hand that always returns multiple addresses.

Vasilij
From 8db9d5d79e63e3a552e5ab2a8571d9deeb7fa8f3 Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann 
Date: Mon, 22 Jul 2019 22:49:30 +0200
Subject: [PATCH] C5 compatibility

---
 build-hostinfo |  2 ++
 build-hostinfo.bat |  2 ++
 hostinfo.egg   |  7 +++
 hostinfo.scm   | 22 --
 4 files changed, 27 insertions(+), 6 deletions(-)
 create mode 100755 build-hostinfo
 create mode 100644 build-hostinfo.bat
 create mode 100644 hostinfo.egg

diff --git a/build-hostinfo b/build-hostinfo
new file mode 100755
index 000..56c69a4
--- /dev/null
+++ b/build-hostinfo
@@ -0,0 +1,2 @@
+#!/bin/sh
+"$CHICKEN_CSC" -O2 -d2 -C "$CFLAGS" -L "$LDFLAGS" "$@"
diff --git a/build-hostinfo.bat b/build-hostinfo.bat
new file mode 100644
index 000..c882ab5
--- /dev/null
+++ b/build-hostinfo.bat
@@ -0,0 +1,2 @@
+@echo off
+%CHICKEN_CSC% -O2 -d2 -C %CFLAGS% -L -lws2_32 -L %LDFLAGS% %*
diff --git a/hostinfo.egg b/hostinfo.egg
new file mode 100644
index 000..f6fb52b
--- /dev/null
+++ b/hostinfo.egg
@@ -0,0 +1,7 @@
+;;; hostinfo.meta -*- Hen -*-
+((synopsis "Look up host, protocol, and service information")
+ (author "Jim Ursetto")
+ (dependencies foreigners system-information)
+ (license "BSD")
+ (category net)
+ (components (extension hostinfo (custom-build "build-hostinfo"
diff --git a/hostinfo.scm b/hostinfo.scm
index 7dfd0fc..7ede91a 100644
--- a/hostinfo.scm
+++ b/hostinfo.scm
@@ -60,8 +60,6 @@
 
 #> #include "hostinfo.h" <#
 
-(require-extension srfi-4 lolevel posix)
-
 (module hostinfo
 ;;; Short and sweet lookups
   (current-hostname
@@ -82,10 +80,22 @@
 ;;; Utilities
string->ip ip->string)
 
-  (import scheme chicken
-  extras srfi-4 lolevel posix foreign
- data-structures
-  foreigners)
+  (import scheme)
+
+  (cond-expand
+   (chicken-4
+(import chicken foreign)
+(require extras srfi-4 lolevel posix data-structures foreigners))
+   (chicken-5
+(import (chicken base))
+(import (chicken blob))
+(import (chicken fixnum))
+(import (chicken foreign))
+(import (chicken format))
+(import (chicken string))
+(import (srfi 4))
+(import foreigners)
+(import system-information)))
 
   (define (vector-map p v0)   ; to avoid linking in vector-lib
 (let* ((len (vector-length v0))
-- 
2.22.0



signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

2019-07-20 Thread Vasilij Schneidermann
Hello Matt,

> BTW, I don't see a hostinfo egg for Chicken 5. Is porting hostinfo planned
> or is the functionality available in a different egg?

There is no such thing as a grand plan to port all the eggs, it's been
done so far on a case-by-case basis.  If someone really needs an egg,
they'll port it and notify the author or maintainer of the required
changes.  Some authors and maintainers are proactive about it and port
all of their eggs, but that's apparently not the case for this one.

Looking further at it, it appears it was written by Jim Ursetto who put
up some ported eggs on https://github.com/ursetto recently, but not that
one yet.  From personal experience porting his eggs is challenging due
to use of macros, internal stuff and other trickery.  This one doesn't
look too bad though, I could give it a try if you like.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Building the openssl egg on MacOS

2019-07-15 Thread Vasilij Schneidermann
Hello Lassi,

I maintain the openssl egg these days.

> On MacOS Mojave, "chicken-install openssl" fails because the OS doesn't ship
> any pkg-config definition file for its version of the openssl library. The
> pkg-config definition is supposed to be in a file called 'openssl.pc' but
> 'sudo find / -name openssl.pc 2>/dev/null' turns up no such file for the
> OpenSSL that comes with the OS.
> 
> (In this version of MacOS the openssl library is actually the OpenSSL
> compatibility wrapper of the LibreSSL library: "/usr/bin/openssl version"
> says "LibreSSL 2.6.5". Even though the library is LibreSSL, it's still
> designed to ship with a file named 'openssl.pc' for compatibility with
> OpenSSL. But MacOS doesn't have that file.)

Ugh.  I've always had the impression macOS gets worse with each release,
but this is ridiculous, almost as if they expect everyone to use XCode
for development...

> The easiest workaround is to install a copy of OpenSSL or LibreSSL from the
> popular Homebrew package manager and build the egg using that copy:
> 
> brew install openssl
> export PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig"
> chicken-install openssl
> 
> Or:
> 
> brew install libressl
> export PKG_CONFIG_PATH="$(brew --prefix libressl)/lib/pkgconfig"
> chicken-install openssl

This is what I recommend to everyone who has to work on that kind of
system.  It's sad, but the least painful way of getting work done.

> In principle one could use the openssl library that ships with MacOS to
> build the openssl egg. However, on this OS version I can't find the
>  C header file anywhere in the file system, even though the
> library itself is installed as .

The reason for this is because on macOS you're supposed to use
"frameworks" instead which contain all that information, much like an
.app contains all the files associated with a program.  There's even a
`-framework` option for `csc` which might just make this work... I can't
test this though because I've abandoned that OS many years ago.

> I installed Apple's command-line developer tools using "sudo
> xcode-select --install". As far as I can tell, I don't have the full
> GUI version of XCode anymore with this OS upgrade. I think the GUI
> version is still available free of charge but it may now require a Mac
> App Store login to install. From Chicken's point of view, we
> unfortunately can't assume that people who use Chicken have the full
> version of XCode.

I hereby reiterate my point that doing development on macOS involves
much sadness, such as creating a developer account to do development.
I'm afraid there isn't much else you can do, unless you somehow get gcc
and the rest of the toolchain working without that.

> Many/most MacOS users of intarweb might stumble onto this problem now that
> HTTPS websites are everywhere, so would it make sense to add MacOS-specific
> checks to the build-openssl script? Since it seems tricky to reliably find
> the system OpenSSL header files, maybe it should suggest that people use
> Homebrew as the easiest alternative. I can write and test a patch for the
> 'build-openssl' shell script if it helps (well, I already wrote most of it
> :-)

Before you do that, there is some work I've done on a few more eggs I
maintain, I got fed up with writing user-unfriendly shell scripts that I
rewrote the non-Windows version to use a Scheme program instead doing
basic version detection, falling back to environment variables and
finally bailing out with an error.  You can find the latest version of
it at the breadline repository [1].  Please let me know if that fulfills
your wishes and if not, whether it can be made to do so.  If yes, then
I'd be willing to migrate the openssl egg towards such a script as well.
The reason I haven't done so is because unlike the other eggs I maintain
it's something I'd rather not touch unnecessarily, breakages to it will
be far more annoying to handle than anything else.  And honestly
speaking, OpenSSL isn't nice to deal with either :>

Vasilij

[1] 
https://raw.githubusercontent.com/wasamasa/breadline/master/build-breadline.scm


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [ANN] CHICKEN 5.1.0 release candidate available

2019-06-13 Thread Vasilij Schneidermann
Hello,

Operating system: Raspbian
Hardware platform: Raspberry Pi 2 (arm32)
C Compiler: GCC
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Statically compiling with additional eggs in Chicken 5

2019-05-07 Thread Vasilij Schneidermann
Hey Jeff,

> I'm wondering if anybody has gotten static compiles to work with any
> of the following eggs: postgresql, sqlite3, or sql-de-lite?

The difference between these eggs and everything else are foreign
dependencies they link against.  Normally you'd link against a shared
library provided by your OS, however for static linking you'd need to
have a statically linked version of that library around.  The details
depend on your OS, on Arch Linux for instance one can set the
`staticlibs` option in a PKGBUILD to not strip static libraries obtained
from the build (which means that the build should produce one, the
details of which depend very much on the package and its build system).

Alternatively, if the library they link against is small enough to be
shipped with the egg, the bundled sources could be compiled instead.
The sql-de-lite egg *should* support this mode of operation, I didn't
test it though when porting it.

> [...]
> collect2: error: ld returned 1 exit status

Note how this fails at the linking stage.  In other words, no suitable
version of the library providing the symbols has been found.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] hahn: chicken 5 port

2019-04-12 Thread Vasilij Schneidermann
Hey Robert,

> I ported hahn to chicken 5. You can find the release here:

Just wondering, are you its maintainer now?  If yes, then there's no
mention of it in the .egg file.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] error when building freetype egg

2019-04-09 Thread Vasilij Schneidermann
Hey Kristian,

> When I chicken-install freetype, I get this:
> 
> /home/klm/.chicken-install/cache/freetype/freetype.c: In function
> ‘stub2714’:
> /home/klm/.chicken-install/cache/freetype/freetype.c:820:6: error:
> ‘FT_GlyphSlotRec’ {aka ‘struct FT_GlyphSlotRec_’} has no member named
> ‘reserved’
>  g2615->reserved = g2616;

I can reproduce this.  It's a breaking change in freetype.h:

FT_UInt glyph_index; /* new in 2.10; was reserved previously */

> Maybe someone can look into a proper fix for this. Thanks,

I suspect you'd have to do some ugly preprocessor/cond-expand tricks.
Help with the latter is welcome :)  Freetype2 gives us the
FREETYPE_MAJOR/_MINOR/_PATCH macros (useful at build time) and the
FT_Library_Version function (useful at run time) to determine the
current version.


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] installing breadline Was: is the readline egg dead?

2019-03-24 Thread Vasilij Schneidermann
Hello Erik,

> FWIW, breadline builds and loads flawlessly on the in-development
> version of Slackware.

That's interesting.  Could you please post the output of ldd run against
its .so file?  I did this on both Slackware 14.1 and Arch Linux, on
Slackware it wasn't linked against ncurses, on Arch Linux it was.  I got
the hint about linking to ncurses from this forum discussion [1].  Since
ncurses is a readline dependency in any case, I figured it wouldn't hurt
to always link to it.  But who knows, maybe I'll run into a user on
another distro which does things differently and expects them to link
against terminfo or so :)

Vasilij

[1] 
https://forum.segger.com/index.php/Thread/925-libreadline-so-5-undefined-symbol-PC/


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] installing breadline Was: is the readline egg dead?

2019-03-23 Thread Vasilij Schneidermann
Hello Marco,

> Thanks!  I  am trying breadline, but,  after a number of  other eggs are
> installed  I get  this  error,  most likely  because  I  still have  GNU
> Readline 6.3  on my Slackware64  14.2 installation (which is  the latest
> Slackware, sigh!):

Thanks for the bug report.  I picked a Slackware64 14.1 Docker image,
installed C5 into it and managed reproducing your issue.  After messing
around a lot with the system I eventually discovered the reason for this
error message, on Slackware it's expected that interactive programs link
against ncurses (which their readline package doesn't, unlike mine).

I've released a new version of the package now that explicitly links against
ncurses.  In case you don't want to wait for a day or so for it to
appear in the coop, execute the following:

git clone https://github.com/wasamasa/breadline
cd breadline
chicken-install

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] is the readline egg dead?

2019-03-23 Thread Vasilij Schneidermann
Hello Kristian,

> I don't know about the status on the C4 readline egg, whether a C5 port is
> planned or whether it's considered obsolete.

I've contributed to the readline egg before and eventually reached the
conclusion that I'm better off developing my own with a different,
incompatible API.  I've also contacted its author regarding plans with a
C5 port and received no reply whatsoever.  For this reason I published
my version under the name breadline for C5, to show that it's a
completely different thing.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Back from the dead: pstk

2019-02-26 Thread Vasilij Schneidermann
Hey Heinz,

> Haven't done any changes to the code for now, other than C5 compatibility
> tweaks, and setting default tclsh to tclsh8.6. I'm amazed that this
> decade-old code works on C5 pretty much out of the box.

Looks good.  One thing you might want to fix: C5 uses a R7RS-style
organization for core modules, so code like `(import (chicken base))`
maps to `(import chicken.base)` and `(import (srfi 1))` to `(import
srfi.1)` (which itself is an alias to `srfi-1` apparently).  The exact
mapping behind the scenes is more of an implementation detail, for this
reason I prefer the version with more parentheses.  It also helps with
compatibility, in case you ever want to write code running on more than
one Scheme implementation.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Back from the dead: pstk

2019-02-26 Thread Vasilij Schneidermann
Hello Heinz,

> I threw out the SVN backlog when importing to git, so maybe the C4 egg
> should continue to use the old SVN repository instead. Otherwise pstk should
> replace Chicken/Tk as the "maintained" Tk egg at this point. I do plan on
> maintaining both 4 and 5 versions, in any case.

This reminds me of one more thing, the tk egg has surprisingly useful
HTML documentation and includes a beginner's tutorial.  Currently it's
hosted at  and can be
used with the pstk egg as well.  Perhaps you might want to include it
into your repository as well?

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Chicken/Tk

2019-02-13 Thread Vasilij Schneidermann
Hello Heinz,

I've looked into the state of GUI eggs for some time and even
contributed a few of my own, way before the release of C5.

> I'm planning on using Tk in a project, and was wondering what's the current
> status of Tk support in Chicken. So Chicken 4 has two eggs, pstk and tk. Of
> these, pstk is listed under "Unsupported or redundant". What's the reason
> for that? I thought pstk was essentially an enhanced version of Wolf-Dieter
> Busch's Chicken/Tk.

You're correct, pstk is an enhanced version of tk with extra commands
(most notably for the ttk extension which allows limited theming) and a
more agreeable license.  Back then I've asked Felix Winkelmann the same
question about its status, the result of that discussion was that he
didn't know either, but agreed to swap both (so that tk would be
obsoleted and pstk in the GUI section) provided that a new maintainer
steps up.  I didn't consider myself good enough for the task back then,
so nothing happened.

> Also, is anybody working on porting either of these eggs to Chicken 5? I'll
> probably stick to Chicken 4 for my project for the time being, since a
> number of distros don't ship C5 yet. I'd volunteer to port the egg myself at
> some point in the future though, once I do transition to 5.

I've worked on porting a number of eggs to ensure everything popular can
be used with C5, but stopped in favor of other projects I'm working on.
Porting the pstk egg shouldn't be hard though, the most challenging bit
would be finding a maintainer.

> On a side note, a while ago I was in contact with Mr. Busch and asked if he
> would relicense the tk egg under BSD terms, to which he agreed. As far as I
> can tell he hasn't actually taken any steps to do so, however. In any case,
> afaik the "Bremer License" is not applicable here, because it specifically
> and exclusively covers the OSCI library, of which Chicken/Tk is not a
> component. So in it's current state, Chicken/Tk is not free software,
> strictly speaking.

This is lamentable, but not the end of the world.  If a maintainer steps
up for pstk, it would supersede the tk egg and no licensing issues will
arise from it.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] csc switch for linking foreign libraries?

2019-01-18 Thread Vasilij Schneidermann
Hello Christoph,

> Understandably. Since I didn't link libmosquitto.so to it. But *HOW*?! I
> tried '-lmosquitto', but that's not passed on to gcc. Which is the correct
> way?

I'll assume for now that you're using CHICKEN 5 because in CHICKEN 4
it's sufficient to pass `-lmosquitto`.  This convention has been changed
as it collided with other flags starting with "-l", you'll need to use
`-L -lmosquitto` to pass the option to the linker.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Fwd: Peeking N characters in string ports

2019-01-11 Thread Vasilij Schneidermann
Hello David,

I've run into a similar problem when trying to detect magic bytes for
unknown image formats.  Most allowed figuring out the format by checking
four bytes, one after three bytes.  I've solved this problem by
rethinking it a bit, first read in three bytes and compare, if it's not
the three bytes format, read in one more byte and check the remaining
signatures against the combination of the last three bytes and the
fourth one.  While this was slightly more verbose than an `unread-char`
solution, it was still simple enough to understand.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Error installing egg, but only on Raspbian

2019-01-09 Thread Vasilij Schneidermann
Hello Christoph,

> I'm a bit lost here as to *where to start* looking to solve this. Any
> suggestions / comments?

There's a few things you can try:

- C5 creates many files during the installation process, perhaps you can
  find what's going wrong in them.
- Try uninstalling the egg including all dependencies, then install each
  dependency on its own and check whether it's successful.  Chances are
  one specific dependency fails installing properly.
- If I had to guess what's going wrong, some eggs depend on foreign
  libraries.  Coming from Arch I find it easy to forget that on Debian
  and its derivatives, you must install the header packages additionally
  to the library ones.  This would affect the openssl egg which I happen
  to maintain for C5, but never tested on Debian.

Vasilij


signature.asc
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Geiser now has Chicken 5 Support

2018-11-17 Thread Vasilij Schneidermann
> That'd be a missing elisp method; it's used in the version check.
> 
> What version of emacs are you using?

`equalp` is from cl.el, so unless you've loaded it up, it won't be
defined.  This is therefore most likely an oversight in the code.  That
being said, `equalp` is very close to `equal`, so if you can, use that
instead.

Vasilij Schneidermann

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] string-ci<=? and string-ci>=?

2018-09-11 Thread Vasilij Schneidermann
Hey Sven,

> > (string-ci<=? "test" "tes")
> #t
> > (string-ci>=? "test" "tes")
> #f

This is odd. Here's some source code:

  (set! scheme#string-ci<=? (lambda (s1 s2)
  (compare
   s1 s2 'string-ci<=?
   (lambda (len1 len2 cmp)
 (if (eq? cmp 0)
 (fx>= len1 len2)
 (fx< cmp 0) ) ) ) ) )
  (set! scheme#string-ci>=? (lambda (s1 s2)
  (compare
   s1 s2 'string-ci>=?
   (lambda (len1 len2 cmp)
 (if (eq? cmp 0)
 (fx<= len1 len2)
 (fx> cmp 0) ) ) ) ) ) 

>From what I can tell, `cmp` ends up being zero if the `memcmp` called by
`compare` returns zero for both strings, with the smaller length as last
argument.  This happens when they share the same prefix, so in this case
you'd run into that branch, then compare `len1` against `len2`.  As
`len1` is larger, `string-ci<=?` returns #t.  The question is, what
should the correct comparator be here?

Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [Chicken-hackers] Some questions about CHICKEN 5 eggs and modules

2018-08-30 Thread Vasilij Schneidermann
> So the basic problem is to install multiple sets of files, in separate
> steps? I think for "scheme-include" components this should be possible,
> but (as far as I can see) this is not currently possible for "c-include"
> components (but could be added).

It's for more than that.  SPOCK for instance installs its Scheme *and*
JS runtime into PREFIX/lib/chicken/8/spock/.  The latter is neither a
scheme-include nor a c-include.  Feathers installs itself into
PREFIX/share/chicken/feathers.tcl.  I'm not sure what I'd categorize
these as, but I suspect these eggs cannot be ported until you can
specify a PREFIX-relative destination directory (as opposed to
specifying the type of file to be installed).

Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Test-Mail

2018-07-12 Thread Vasilij Schneidermann
Hello Martin,

Looks good to me. I've attached a screenshot of the last two threads as
viewed in Mutt.

Vasilij
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] egg readline - funny behaviour

2018-07-12 Thread Vasilij Schneidermann
Hello Martin,

> if Alexej Magura is around - may be the following is a small bug (could
> also be an artifact of GNU readline - I don't know).

I doubt he's around here, but I've had luck contacting him on GitHub [1].

> In case you are wondering - the comment of the 4.th line is a "real"
> comment used in the examples of the datatypes egg (wiki) - the rest of
> the 4 lines I made up for simplicity.

I can reproduce this.  The issue is that you get a continuation prompt
due to an unbalanced s-expression after the comment starter.  This is a
purely cosmetical issue, evaluating ;) will restore the normal prompt.
To fix this you'd have to implement a smarter parser in the readline
egg.  This is unfortunately done in C, not Scheme, so fixing this is
harder than it should be.  I've tried my hand at reimplementing the
algorithm in Scheme for the parley egg, you can find it in my dotfiles
[2].

Vasilij

PS: Could you please start a new thread for every new topic?  This
should be a matter of composing a new email with
chicken-users@nongnu.org in the To: field, you can then use your email
client's reply-all feature to respond to any subsequent emails.  That
way it's easier to track conversations.

[1]: https://github.com/amagura/eggs
[2]: https://github.com/wasamasa/dotfiles/blob/master/home/wasa/.csirc

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] context sensitive auto-completion for symbols in SciTE

2018-06-15 Thread Vasilij Schneidermann
Hello Martin,

> ...now I am a little bit confused.
> 
> I read the parlay egg docu again, remembered that there is no
> autocompletion included - your repository looks like an egg
> (https://github.com/wasamasa/readline) - but nowhere to be found in
> http://wiki.call-cc.org/chicken-projects/egg-index-4.html
> 
> Am I blind?

It's not published to the coop, simply because there already is a
readline egg and I couldn't come up with a good name for my own,
incompatible egg.  Their interfaces are completely different.  You can
install mine by downloading the sources, then executing
`chicken-install` in its directory.

My code for integrating completions into Parley is in my dotfiles [1].

Vasilij

[1]: https://github.com/wasamasa/dotfiles/blob/master/home/wasa/.csirc

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] context sensitive auto-completion for symbols in SciTE

2018-06-15 Thread Vasilij Schneidermann
Hello Martin,

> The problem with this imlementation is: the symbols of "used" modules
> are missing.

I've written a replacement for the readline egg [1] for a few reasons,
one of them being its completion suffering from the same issue you
describe.  Perhaps you'll find its completion code [2] useful, I've been
able to reuse it for the parley egg so far.

Vasilij

[1]: https://github.com/wasamasa/readline
[2]: 
https://github.com/wasamasa/readline/blob/master/readline-scheme-completion.scm

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] bug or usage problem with posix group-information and there is no change-group?

2018-02-14 Thread Vasilij Schneidermann
Hello Matt,

> In the repl calling group-information with the string name of a group
> works fine, in compiled code I get an error, expected fixnum but
> received string. I tested with Chicken 4.13

I can reproduce this with the test code being `(group-information "root")`.
FWIW, I get a warning during compilation, not an error.  The compiled
code runs just fine and emits the expected result.  This is due to the
relevant entry in the `types.db` file stating that the group-information
procedure accepts an integer only.  If you unpack the release tarball
and change the enclosed `types.db` to specify `(or string fixnum)` for
the first argument of the function, the compiled CHICKEN should behave
correctly.

> Also I see a change-file-owner but no change-file-group. A change-file-
> group would be useful as you can change the group without being root.
> I.e. an analog to the chgrp command would be useful.

Have you inspected the documentation of that procedure?  It accepts
three arguments, the path to the file and the new user ID and group ID,
therefore it allows implementing both `chown` and `chgrp`.  I don't
think an extra procedure is necessary.

Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Bug with #:optional in args egg?

2017-06-20 Thread Vasilij Schneidermann
Hello Diego,

> While I find it a bit odd that someone might want the args behavior
> the way it is (I guess it seems less versatile to me)

I intended it more as "it would be a bug to change the behavior at this
point".  I've looked into this a bit more and discovered that the args
egg is pretty much a frontend to SRFI-37 and doesn't do any parsing
itself.  If the CHICKEN implementation adheres strictly to the reference
implementation provided by its original author, that would suggest a bug
in the SRFI itself.  I've attached a test program reproducing the issue
in the srfi-37 egg.

> I've explored getopts-long per your recommendation and I think I even
> like it more. My only current gripe with getopts-long is that it
> doesn't seem to support passing values to long options with a space
> instead of an "=" (even though one of th examples provided says
> otherwise, the "--apples" "Granny Smith" bit).

Well, that's unfortunate.  I've reported a bug for its printing of long
options recently and my patch got in quickly.  I'd recommend contacting
Ivan Raikov regarding this issue, you can find his contact details on
the wiki[1].

Cheers
Vasilij

[1]: http://wiki.call-cc.org/users/ivan-raikov


test.scm
Description: Lotus Screencam
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Bug with #:optional in args egg?

2017-06-19 Thread Vasilij Schneidermann
Hello Diego,

I'm not sure whether this is a bug and fixing it is desired.  If
changed, it would affect existing programs using the args egg that would
no longer work in the old way.  Also, there are programs that do
argument parsing this way, albeit not many and typically only for a few
select arguments, like mysql for passwords (typing a space between -p
and the argument made the password check fail) and compilers (for -L and
alike).

I've switched to the getopt-long egg for this reason.  While it doesn't
do as much magic and takes more effort to understand, the command line
interfaces created with it feel completely like proper GNU programs.

Cheers
Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Trying to understand srfi-41 (streams)

2017-01-28 Thread Vasilij Schneidermann
Hello Bahman,

> And of course, upon further investigation, the head hadn't moved an inch
> after `take` or `car`.  What am I missing?

looks to me as if the interface is purely functional.  (stream-car
(stream-drop 2 my-stream)) evaluates to 2.  The original SRFI page shows
a few examples with stream-let and stream-fold for processing a stream
by looking at its car and proceeding on its cdr.

Cheers
Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] chicken-install AD

2016-08-04 Thread Vasilij Schneidermann
Hello,

> I guess it was working on 4.9 and before, any ideas of how to solve this?

Peter Bex submitted a pull request at upstream [1], but it hasn't been
accepted yet.  You could therefore clone its sources, apply the changes
and install the egg by running `chicken-install` in its directory.

[1]: https://github.com/abarbu/AD/pull/1

Cheers
Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Threads, and async

2016-07-22 Thread Vasilij Schneidermann
Hello,

> About libuv, Chicken not very well suited for callback-based ffi, so there
> is no official available extensions, but integration is possible and working
> reasonable.

Do you have any material on doing FFI with callbacks?  I've had to solve
this problem before for GUI toolkits and settled for writing a generic
handler that did the dispatching to the actual procedure with a scheme
hash table, but I'd like to see small, self-contained examples on how
one could do better.

Cheers
Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] SQL in practice with CHICKEN

2016-07-14 Thread Vasilij Schneidermann
Hello,

I'm using sql-de-lite in a few demos on .  The code
can be found on  and isn't doing
anything special, asides from initializing the database if it hasn't
been set up before.

Cheers
Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] CHICKEN meetup reminder

2016-07-13 Thread Vasilij Schneidermann
Follow-up information: The listed price is for one person and two
nights, so you end up paying 20-25€ per night.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] CHICKEN meetup reminder

2016-07-12 Thread Vasilij Schneidermann
Hello,

I'll be in Nuremberg from Friday noon to Sunday noon.  I'm fine with the
cheapest accomodation which would be the A Hostel at the central
station.  Their best offers are for a room of four (49,40€) or six
(45,60€) beds respectively.  Please contact me if you're interested in
sharing one with me.

Cheers
Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Installing chicken on windows

2016-07-08 Thread Vasilij Schneidermann
Hello folks,

I haven't posted to this list before as I'm more of an IRC person, but
have been notified that I might want to engage this time ;)

> Oh, as an aside, it would be fantastic to have IUP be just as easy to
> install on Linux/Unix. Sadly this is not the case. I have not surveyed
> the GUI toolkit world recently. Is there a better alternative
> available for Chicken now?

I happen to be currently writing my thesis on CHICKEN or more
specifically, GUI programming approaches, the current state of GUI
programming with CHICKEN and the evaluation of interesting looking
libraries to write eggs for.  In the course of this, I wrote and
published three eggs, kiwi[1], nuklear[2] and libui[3].

libui is the closest thing to IUP.  It supports Windows (Win32), OS X
(Cocoa) and Linux/Unix (GTK) desktops, provided they're up-to-date.
Unlike IUP, it's relatively simple to build as it only requires CMake as
prerequisite.  My issues with it so far are that it's still an immature
project and that the API isn't perfect, but that shouldn't be as
noticable with the egg.

As I'm a Linux user, I haven't tested whether any of the eggs could be
made to work with Windows or OS X.  While I'm fairly sure that I could
get a Windows VM going, I'm unfamiliar with the process of using tools
originating from the Linux world as there appear to be several
incompatible ways of doing this and CHICKEN itself is no exception.  I
have no idea about the state of OS X virtualization and getting a Mac
Mini for this purpose doesn't exactly sound attractive...

Any help from more knowledgeable people on this topic is appreciated!

Cheers
Vasilij

[1]: http://wiki.call-cc.org/eggref/4/kiwi
[2]: http://wiki.call-cc.org/eggref/4/nuklear
[3]: http://wiki.call-cc.org/eggref/4/libui

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users