Concurrency Document problem

23 views
Skip to first unread message

George

unread,
Nov 20, 2022, 9:40:34 PM11/20/22
to Extempore
Hello all!
I think there is something wrong in the "Concurrency" document.
https://extemporelang.github.io/docs/reference/concurrency/
https://github.com/extemporelang/extemporelang.github.io/blob/master/_docs/reference/concurrency.md

On the line where we first meet "(ipc:bind-func "myproc" times2)" we get an error:

"function(symbol->string): argument 1 must be: symbol
argument values: (#<<CLOSURE 0x7f7eda012480><CODE (args (if (and (not (null? args)) (symbol? (car args))) (if (equal? (car args) (quote xtlang)) (quote times2_adhoc_W2k2NCxpNjRd) (if (null? (cdr args)) (eval (string->sexpr (string-append "(" "times2_adhoc_W2k2NCxpNjRd" "." (symbol->string (car args)) ")"))) (eval (append (string->sexpr (string-append "(" "times2_adhoc_W2k2NCxpNjRd" "." (symbol->string (car args)) ")")) (list (cadr args)))))) (apply times #<PROC symbol->string>
Trace: ipc:bind-func"

Things going OK up to that point .

I notice too that in the "Code" editor, "ipc:bind-func" is highlighted differently from
"ipc:define" . The "bind" part is highlighted but the "-func" part is not. Strange.

 I realise there is a warning at the beginning of the document to the effect that
 "Some of the threading stuff (particularly in xtlang) has changed slightly since this was written"
 
 Hope someone out there has a ready fix for this as I am finding the doc very interesting. First time I have worked through it.
 
 Regards
 George

George

unread,
Nov 20, 2022, 10:19:09 PM11/20/22
to Extempore
Oh dear, I was too quick on the draw here.
It's just a typo. A quote missing!
(ipc:bind-func "myproc" times2) should be (ipc:bind-func "myproc" 'times2)
And all goes well.

The real problem comes at the end of the doc with "(bind-func native_threads ......."
It compiles OK :
Compiled:  my_os_thread >>> [i32]*
Compiled:  native_threads >>> [i32,i64]*

But on calling :
(native_threads 5) 
I get a zsh: segmentation fault  crash.

Any ideas?
Regards
George

George

unread,
Nov 21, 2022, 3:55:22 PM11/21/22
to Extempore
By the way
The missing quote occurs in Andrew's original post in 2014: "of Threads, Processes, Concurrency and Parallelism"
The Concurrency doc is a straight copy of that post. Someone who is familiar with changes happening since 2014
might be able to shed some light ...

The only other reference to related stuff is Ben's "fleet.xtm"  library  (sys:load "libs/external/fleet.xtm")
and his example (examples/external/fleet.xtm)  NOT (examples/contrib/fleet.xtm).
I wonder if someone could give me some clues as to what that is all about.
Haven't yet tried to run it.

Regards
George

Ben Swift

unread,
Nov 28, 2022, 1:34:28 AM11/28/22
to extemp...@googlegroups.com
Hey George

Wow, fleet.xtm is a blast from the past. It was a way of doing distributed computing using the now-defunct [CoreOS](https://thenewstack.io/say-goodbye-to-coreos). It worked fine at the time, but CoreOS is long dead and there are probably better ways to do that stuff now.

`libs/contrib` is really the wild west (that's the point of contrib). Some of it still works, some of it has long bit-rotted, some of it is in that weird schrodinger's code state...

Ben
>>> On the line where we first meet "*(ipc:bind-func "myproc" times2)*" we get an error:
>>>
>>> *"function(symbol->string): argument 1 must be: symbol
>>> argument values: (#<<CLOSURE 0x7f7eda012480><CODE (args (if (and (not (null? args)) (symbol? (car args))) (if (equal? (car args) (quote xtlang)) (quote times2_adhoc_W2k2NCxpNjRd) (if (null? (cdr args)) (eval (string->sexpr (string-append "(" "times2_adhoc_W2k2NCxpNjRd" "." (symbol->string (car args)) ")"))) (eval (append (string->sexpr (string-append "(" "times2_adhoc_W2k2NCxpNjRd" "." (symbol->string (car args)) ")")) (list (cadr args)))))) (apply times #<PROC symbol->string>
>>> Trace: ipc:bind-func"*
>>>
>>> Things going OK up to that point .
>>>
>>> I notice too that in the "Code" editor, "*ipc:bind-func*" is highlighted differently from
>>> "*ipc:define*" . The "bind" part is highlighted but the "*-func*" part is not. Strange.
>>>
>>> I realise there is a warning at the beginning of the document to the effect that
>>> "Some of the threading stuff (particularly in xtlang) has changed slightly since this was written"
>>>
>>> Hope someone out there has a ready fix for this as I am finding the doc very interesting. First time I have worked through it.
>>>
>>> Regards
>>> George
>
> --
> You received this message because you are subscribed to the Google
> Groups "Extempore" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to extemporelan...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/extemporelang/460b46f8-b179-4def-9178-d282924cd11an%40googlegroups.com
> <https://groups.google.com/d/msgid/extemporelang/460b46f8-b179-4def-9178-d282924cd11an%40googlegroups.com?utm_medium=email&utm_source=footer>.

George

unread,
Nov 28, 2022, 3:29:46 PM11/28/22
to Extempore
Thanks Ben
Oh well I'll have to resist temptations to prise open Schrödinger's  box to check the viability of cats.
I got into that topic while trying to set up extempore in a second old MacBook. 

Records George

Reply all
Reply to author
Forward
0 new messages