Re: confused about make-module and eval

2020-03-23 Thread Massimiliano Gubinelli
I think a fresh module do not have any binding. So 'lambda is not defined. You 
would have to create bindings inside the module, maybe you could just import 
the-scm-module .

In particular this can be a way to allow only certain functionality to be 
available to the program you eval.

Best
max


> On 24. Mar 2020, at 01:32, Matt Wette  wrote:
> 
> I expect this to work, but it does not.  Any anyone elaborate?
> What is the minimum module that can make this work?  (make-fresh-use-module)?
> 
> scheme@(guile-user)> (eval '(lambda (a b c) 1) (make-module))
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> Unbound variable: lambda
> 
> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
> scheme@(#{ g188}#) [1]>
> 
> 




confused about make-module and eval

2020-03-23 Thread Matt Wette

I expect this to work, but it does not.  Any anyone elaborate?
What is the minimum module that can make this work?  (make-fresh-use-module)?

scheme@(guile-user)> (eval '(lambda (a b c) 1) (make-module))
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Unbound variable: lambda

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(#{ g188}#) [1]>




Re: single-stepping throwgh a procedure is possible in guile 3?

2020-03-23 Thread Jeremy Korwin-Zmijowski
Le vendredi 13 mars 2020 à 11:02 +0100, Michelangelo Rodriguez a
écrit :
> Hi all,
> I'm studying guile and scheme and as sayd in the subject, i would
> like
> to know if single-stepping throwgh a procedure is possible in guile
> 3.
> I looked at internet for information, and i found a reference that is
> not applicable in guile 3.
> Greetings,
> Michelangelo
> 

Hey Michelangelo !

What is the reference you are mentionning ?

I saw Andy Wingo demonstrate something close to what you are looking
for at Guix Days 2020, but failed to reproduce it back home haha.

Maybe, if Andy see this thread and have some time to give some hints...
:)

I join snippets of what I have, but I don't know how to make them work
in the REPL...

Jérémy

(use-modules (system vm trap-state)
	 (system repl repl)
	 (system vm vm))

(set-vm-trace-level! 1)

(define oneplus
  (lambda (x)
(+ 1 x)))

(with-default-trap-handler
 (lambda (frame idx name)
   (start-repl)
   (pk frame idx name))
 (lambda () (map oneplus '(1 2 3
(use-modules (system vm trap-state)
	 (system repl repl)
	 (system vm vm))

(set-vm-trace-level! 1)

(define oneplus
  (lambda (x)
(+ 1 x)))

(install-trap-handler! pk)

(map oneplus '(1 2 3))


Re: Python on guile

2020-03-23 Thread Arne Babenhauserheide


Stefan Israelsson Tampe  writes:

> Now in corona times I'm working quite a lot with python-on-guile fixing
> bugs in the parser and compiler. Trying to add and test more python
> modules. My test case is to get IPython running on python on guile.

You’re awesome! Thank you!

It sounds like the time could be coming to actually test the speed.
Maybe you can look into the pypy benchmarks for that:

https://speed.python.org/
https://speed.python.org/about/ — with link to the code

Those would give the first truly comparable test of the speed of Guile
vs. a non-Scheme — and a practical path into improving performance based
on higher level usage patterns.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken



Re: Need help starting a project in Guile - distributed DE / GUI toolkit using Wayland

2020-03-23 Thread Neil Jerram
On Mon, 23 Mar 2020 at 01:36, Jan 
wrote:

> Hello,
>
> I would like to make my project in Guile, but I'm not really an
> advanced programmer yet - I made some hello worlds in C++, simple 2D
> and 3D games in JS using WebGL and I've read basics of Guile from the
> manual and Scheme generally from SICP (few chapters) and other sources,
> made some really simple programs in Guile and packages for Guix.
>
> The problem is I don't know where to start and which parts of the
> language and features of GNU/Linux I have to understand well in order
> to at least make a prototype.
>
> The project idea is a distributed and extensible DE and GUI toolkit
> treating its elements as objects (something like the UNIX philosophy).
> I would like to use Wayland, or if possible wlroots, but there are no
> Guile bindings available.
>
> So for the project I need:
> - a wayland client written in Guile, wlroots (foreign function
>   interface?) I need to talk to the wayland server somehow
> - a good interprocess communication - I want different components of my
>   DE / GUI toolkit to be separated processes talking to each other
>   (POSIX socets?)
>
> Sorry for my vague understanding of the subject, I'm not studying CS.
> I would like to know what should I read/know to make this real.
> Where can I read about programming for an UNIX-like OS?
> Can I avoid learning C/C++ deeply? I know basics of C syntax, but
> I would like to do everything in Scheme, you know, it's much cooler :)
>
>
> Thanks for reading this
>
> Jan Wielkiewicz
>

Hi Jan,

You don't need specially coded Wayland bindings for Guile.  You can use
Guile's generic Foreign Function Interface [1].  For an example, see [2],
although that particular code might be outdated as I haven't run it for a
while.

[1]
https://www.gnu.org/software/guile/manual/html_node/Foreign-Function-Interface.html#Foreign-Function-Interface
[2] http://git.savannah.nongnu.org/cgit/ossaulib.git/tree/glib/dbus.scm

Best wishes,
Neil