--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/qilang/CACy6W0DLGhcqpFjX_bCME9fWoskrtXLAw8ECHVqz5vfJLEHYug%40mail.gmail.com.
(let PV (shen.prolog-vector)
Var (shen.newpv PV)
Bind (shen.bindv Var "hello" PV)
(shen.deref Var PV))
(let PV (shen.prolog-vector)
Var (shen.newpv PV)
Bind (shen.bindv Var "hello" PV)
[(shen.pvar? Var) (shen.lazyderef Var PV) (shen.deref Var PV)])
Bruno Deferrari wrote:
> What is the output of this expression?
>
>
> (let PV (shen.prolog-vector)
>
> Var (shen.newpv PV)
>
> Bind (shen.bindv Var "hello" PV)
>
> (shen.deref Var PV))
"hello"
> And this one:
>
> (let PV (shen.prolog-vector)
>
> Var (shen.newpv PV)
>
> Bind (shen.bindv Var "hello" PV)
>
> [(shen.pvar? Var) (shen.lazyderef Var PV) (shen.deref Var PV)])
[true "hello" "hello"]
Those look rather expected, no?
Is there a way to see the decomposition of prolog? forms into
something like this?
Shen, www.shenlanguage.org, copyright (C) 2010-2023, Mark Tarver
version: S38.3, language: Scheme, platform: chez-scheme 10.0.0
port 0.35, ported by Bruno Deferrari
(0-) (defprolog consit
X [1 X] <--;)
(fn consit)
(1-) (ps consit)
[defun consit [V22 V23 V24 V25 V26 V27] [if [shen.unlocked? V25] [let W28 [shen.lazyderef V23 V24] [let W29 [lambda Z30 [do [shen.incinfs] [is! V22 Z30 V24 V25 V26 V27]]] [if [cons? W28] [let W31 [shen.lazyderef [hd W28] V24] [let W32 [freeze [let W33 [shen.lazyderef [tl W28] V24] [let W34 [lambda Z35 [W29 Z35]] [if [cons? W33] [let W36 [hd W33] [let W37 [shen.lazyderef [tl W33] V24] [let W38 [freeze [W34 W36]] [if [= W37 []] [thaw W38] [if [shen.pvar? W37] [shen.bind! W37 [] V24 W38] false]]]]] [if [shen.pvar? W33] [let W39 [shen.newpv V24] [shen.gc V24 [shen.bind! W33 [cons W39 []] V24 [freeze [W34 W39]]]]] false]]]]] [if [= W31 1] [thaw W32] [if [shen.pvar? W31] [shen.bind! W31 1 V24 W32] false]]]] [if [shen.pvar? W28] [let W40 [shen.newpv V24] [shen.gc V24 [shen.bind! W28 [cons 1 [cons W40 []]] V24 [freeze [W29 W40]]]]] false]]]] false]]
(2-) ((foreign scm.pretty-print) (ps consit))
(defun
consit
(V22 V23 V24 V25 V26 V27)
(if (shen.unlocked? V25)
(let W28 (shen.lazyderef V23 V24)
(let W29 (lambda
Z30
[do (shen.incinfs) (is! V22 Z30 V24 V25 V26 V27)])
(if (cons? W28)
(let W31 (shen.lazyderef [hd W28] V24)
(let W32 (freeze
[let W33
(shen.lazyderef (tl W28) V24)
(let W34 (lambda Z35 [W29 Z35])
(if (cons? W33)
(let W36 (hd W33)
(let W37 (shen.lazyderef [tl W33] V24)
(let W38 (freeze [W34 W36])
(if (= W37 ())
(thaw W38)
(if (shen.pvar? W37)
(shen.bind! W37 () V24 W38)
#f)))))
(if (shen.pvar? W33)
(let W39 (shen.newpv V24)
(shen.gc
V24
(shen.bind!
W33
(cons W39 ())
V24
(freeze (W34 W39)))))
#f)))])
(if (= W31 1)
(thaw W32)
(if (shen.pvar? W31)
(shen.bind! W31 1 V24 W32)
#f))))
(if (shen.pvar? W28)
(let W40 (shen.newpv V24)
(shen.gc
V24
(shen.bind!
W28
(cons 1 (cons W40 ()))
V24
(freeze (W29 W40)))))
#f))))
#f))
Do the symbolic representations live in
*property-vector* like they do for interpreted functions? I noticed
that and the arity of defprolog functions while poking around last
night.
(3-) (head (read-from-string "(prolog? (consit 1 X) (return X))"))
[[[[[lambda V41 [lambda L42 [lambda K43 [lambda C44 [let X [shen.newpv V41] [shen.gc V41 [do [shen.incinfs] [consit 1 X V41 L42 K43 [freeze [return X V41 L42 K43 C44]]]]]]]]]] [shen.prolog-vector]] [@v true [@v 0 [vector 0]]]] 0] [freeze true]]
> After a quick look I couldn't find anything special in ShenSharp regarding these but just in case.
Yeah, I'm pretty sure there is no special handling of Prolog forms. My
money's on something in the evaluation model, perhaps ShenSharp's
runtime being too eager in the presence of the S series helpers.
> Curly braces are for declaring function types, and the typechecker uses prolog. So if prolog is broken in any way, the typechecker will be too.
>
> So for now I would ignore anything related to the typechecker and focus on figuring out what is the issue with prolog, if you are able to fix it it is very likely that the typechecker will get fixed too.
That makes sense.
Thanks,
Jacob.
--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/qilang/CACy6W0DYA%2BcumGfhkrNTTOVQXk_Sh5sfE4SH50AtokivB7%3D%2Bgg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/qilang/CACy6W0AQzFKAwvb_TNzLzD_qppO8StNAJ4UfVtbakF80M1vgug%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/qilang/CACy6W0DArbjLVD6kgb8LkH7XL1x1BLDSm2bz%2BJFYqLksgLd%2Bww%40mail.gmail.com.
Bruno Deferrari wrote:
> IIRC Robert started with ShenSharp but after he got something working well he switched to working on ShenScript, and he put more time and effort on optimizing that one.
Just to see if I could, I built ShenScript and tried ShenSharp against
its test suite. I'm not sure how to get an optimized JS build -
there's been some dependency rot - but the speed doesn't seem that
different (albeit ShenSharp fails one of the Shen 22.4 suites).
In other non-scientific testing, it seems like ShenSharp in release
mode is about 10-20x slower than the CL port and 40-50x slower than
Shen/Scheme.
A couple years, Robert made a comment about wanting to rewrite
ShenSharp and maybe dropping F# altogether. The approach would be to
generate CIL instead of source code or an interpreter, and that's more
or less what I'd like to start poking at next.
Moving onto the S series kernel was not painful, so I'm curious about
resurrecting some of the other ports: Someone's trying to patch
shen-elisp, and as I made the PR that upgraded that port to Shen 21 I
may poke my head in next. Not a ton of activity on many of the port
repos, sadly.
What would the steps be in certifying ShenSharp and getting it to a
releasable state? I don't want to fully fork just yet because Robert
seems to be active on GitHub, exclusively on private repositories. But
I don't want to cram too much into one Git branch: I already took us
all the way through .NET 6, which has support through the end of this
year. It's easy enough to make self-contained releases, though: I did
so to test out the REPL in release mode, with no .NET installed on my
machine I did all the compilation in Docker.
--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/qilang/CACy6W0DfhcNyBZj96HDNF17MBav_ga-HS%3DXy4RrVLswoqktPZQ%40mail.gmail.com.