Discussion:
[Chicken-users] Chicken + IUP precompiled bundle for Raspbian (ARM) available.
Matt Welland
2018-07-09 17:44:05 UTC
Permalink
If you'd like to try Chicken with the IUP gui on your Raspberry pi you can
download a prebuilt binary tar from:

http://www.kiatoa.com/cgi-bin/fossils/opensrc/uv/pkgs/chicken-iup-arm-rasbian-06-08-2018.tar.gz

and untar it into /

I made this with the intention of using it in GNURoot Debian on android.
However the IUP egg uses ffcall which doesn't work on GNURoot, presumably
because it is a chroot environment. The rest of chicken and the installed
eggs seem to work fine.
Thomas Chust
2018-07-09 21:55:07 UTC
Permalink
Post by Matt Welland
[...]
However the IUP egg uses ffcall which doesn't work on GNURoot, presumably
because it is a chroot environment.
[...]
Hello,

to me it seems more likely that some security feature such as
non-executable stack interferes with ffcall. That library is old and I
should really replace it with libffi in the IUP egg at some point – the
problem is just that libffi has a far more complicated API :-/

Ciao,
Thomas
--
When C++ is your hammer, every problem looks like your thumb.
Matt Welland
2018-07-09 22:28:35 UTC
Permalink
Hi Thomas,

First, congratulations on your achievement!

Thanks for the response. I think you are right. On doing a little more
digging I found execstack which seemed to get me past that issue. Now it is
missing libpng16-16. I'll chip away at this a little more.

Matt
-=-
Post by Thomas Chust
Post by Matt Welland
[...]
However the IUP egg uses ffcall which doesn't work on GNURoot, presumably
because it is a chroot environment.
[...]
Hello,
to me it seems more likely that some security feature such as
non-executable stack interferes with ffcall. That library is old and I
should really replace it with libffi in the IUP egg at some point – the
problem is just that libffi has a far more complicated API :-/
Ciao,
Thomas
--
When C++ is your hammer, every problem looks like your thumb.
_______________________________________________
Chicken-users mailing list
https://lists.nongnu.org/mailman/listinfo/chicken-users
Martin Schneeweis
2018-07-10 08:21:57 UTC
Permalink
Hi,

back at playing with types - my current impression is that the compiler
is a little too optimistic (goal: get as much warnings as
possible - optimizations are no concern here).

Example A - compiler gives warning - I am happy:

(: my-add (fixnum fixnum --> float)) ; note the float return type
(define my-add (lambda (a b)
(+ a b)))

(: some-val-w-1 fixnum)
(define some-val-w-1 (my-add 0 1)) ; warning

Example B - compiler gives no warning (not sure why not - I would have
hoped that the compiler assumes the "worst case" - meaning "my-add-2"
returns a float and therefore the variable "some-val-nw-2" cannot be a
fixnum)

(define-type mixed-type (or fixnum float))

(: my-add-2 (fixnum mixed-type --> mixed-type))
(define my-add-2 (lambda (a b)
(+ a b)))

(: some-val-nw-2 fixnum)
(define some-val-nw-2 (my-add-2 1 0.3)) ; return value will be a float

Am I missing some compiler-flags that I am supposed to use?

Chicken 4 (4.13) and Chicken 5 are behaving in the same way - I am
using no compiler-flags - just "csc <filename>" - by the way: using the
compiler-flag "-optimize-level 0" makes the first warning disappear.

Attached is the (Chicken 5) source-code of the tests - "-w-" in a name
means "warning", "-nw-" in a name means "no warning" (and my goal was
to get a warning in all cases - so "-w-" means I got what I expected).

lg
Martin
megane
2018-07-10 14:45:59 UTC
Permalink
Post by Martin Schneeweis
Hi,
back at playing with types - my current impression is that the compiler
is a little too optimistic (goal: get as much warnings as
possible - optimizations are no concern here).
[snip]

Hi Martin,

There are known limitations in the type checker (scrutinizer) that are
being worked on. The fixes won't be in 5.0, but hopefully in some near
future version.

This is the warning I get with my current modifications for Example B:

Warning: at toplevel:
in assignment to toplevel variable some-val-nw-2, type of the value

(or fixnum float)

does not match declared type

fixnum

To get any type checking at all you need to have the scrutinizer
enabled. You can force it by using the -specialize flag, or using
optimization level of >= 3. So using only -optimize-level 0 will
suppress all type warnings.

Cheers,
Martin Schneeweis
2018-07-10 17:44:19 UTC
Permalink
Hi Megane,
Post by megane
To get any type checking at all you need to have the scrutinizer
enabled. You can force it by using the -specialize flag, or using
optimization level of >= 3. So using only -optimize-level 0 will
suppress all type warnings.
- ah - thanks for the info -

lg
Martin
Martin Schneeweis
2018-07-12 08:01:25 UTC
Permalink
Hi,

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

To follow along - the inputs are:

Command line:

csi -no-init

csi (comment in the 4.th line has to be included):

(use (prefix readline rl:))
(current-input-port (rl:make-readline-port))
(define test (lambda () (print "test")))
(test) ; -> ((Types) ... (First) ... (First-set! (value number?)) ...

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.

lg
Martin
Vasilij Schneidermann
2018-07-12 13:02:29 UTC
Permalink
Hello Martin,
Post by Martin Schneeweis
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].
Post by Martin Schneeweis
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-***@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
Matt Welland
2018-07-11 03:38:39 UTC
Permalink
Success with chicken 4.13 + IUP gui egg on the Gemini PDA using GNURoot.
This should work on almost any android phone. Please let me know if you try
it whether it works or not.

Basic instructions at:
http://www.kiatoa.com/cgi-bin/fossils/opensrc/wiki?name=Chicken-IUP-ARM
Post by Matt Welland
Hi Thomas,
First, congratulations on your achievement!
Thanks for the response. I think you are right. On doing a little more
digging I found execstack which seemed to get me past that issue. Now it is
missing libpng16-16. I'll chip away at this a little more.
Matt
-=-
Post by Matt Welland
Post by Matt Welland
[...]
However the IUP egg uses ffcall which doesn't work on GNURoot,
presumably
Post by Matt Welland
because it is a chroot environment.
[...]
Hello,
to me it seems more likely that some security feature such as
non-executable stack interferes with ffcall. That library is old and I
should really replace it with libffi in the IUP egg at some point – the
problem is just that libffi has a far more complicated API :-/
Ciao,
Thomas
--
When C++ is your hammer, every problem looks like your thumb.
_______________________________________________
Chicken-users mailing list
https://lists.nongnu.org/mailman/listinfo/chicken-users
Loading...