[racket-users] How do I control where expressions may appear in a module language?

2020-12-30 Thread Sage Gerard
I'm trying to learn how to restrict where expressions appear. Those expressions 
might be procedure applications, or macros before expansion.

[1] shows a library I use to help me implement a collection pass for a module 
language. To save you some reading, it uses syntax-parse with a lengthy 
#:datum-literals. That's the only way I know how to restrict what expressions 
appear in module context.

One element of the #:datum-literals happens to share an identifier with a bound 
procedure, so I expand the calls as-is in a module-level expression [2][3]. I 
want that procedure to be applied ONLY in the module context, but nothing in 
the language enforces that.

I don't know what I don't know. Could I please get a link to a part of the 
documentation that teaches me what I need to understand? I'm tied between 
querying syntax properties for a fully expanded module, and writing a second 
set of macros that somehow know where they should be. Not sure which is best.

[1]: https://github.com/zyrolasting/xiden/blob/master/pkgdef/expand.rkt
[2]: https://github.com/zyrolasting/xiden/blob/master/pkgdef/expand.rkt#L111
[3]: https://github.com/zyrolasting/xiden/blob/master/pkgdef/expand.rkt#L156

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/bVbaZ_0mwFcWTIaeuwqMUr7TVY6Rhr5dusG9LkbT0gqW7gWIYAb8IOEUYnKQPIVR2ZrDGm9QMGnW-2YvYqw81oUJVCSCuwhuX_Wx2OGVG-w%3D%40sagegerard.com.


Re: [racket-users] Racket and Assembly

2020-12-30 Thread Hendrik Boom
On Wed, Dec 30, 2020 at 02:44:35PM -0500, Matt Jadud wrote:
> Hi Daniel,
> 
> As a start to answering your question(s), you might try the 2019 ICFP
> experience report on rebuilding Racket on top of Chez Scheme is probably a
> good place to look.
> 
> https://www.cs.utah.edu/plt/publications/icfp19-fddkmstz.pdf
> 
> This will give you an overview of the architecture of the language/runtime,
> and should serve as a starting point for additional questions.
> 
> Cheers,
> Matt

There is an implementation that was designed to compile straight to C:
  Gambit.
You can also use it to compile to C++ if you need to.

It has mechanisms that allow you, if you wish, to specify how entities 
you define will be translated.  (I strongly suspect that these 
mechanisms are used in its implementation).

This makes it useful as a kind of scripting language on top of C.

These mechanisms are not available in its interpreter.

Have fun exporing it.  It does not have as extensive a set of libraries 
as Racket does.

Someone has even managed to make a PC boot directly into the Gambit 
interpreter, without an intervening OS.

-- hendrik

> 
> 
> On Wed, Dec 30, 2020 at 2:10 PM Daniel Santos 
> wrote:
> 
> > Hi.
> >
> > I really want to know is if Racket compiles code directly into assembly?
> > Or does it do: Racket -> C -> Assembly ? Or something else ?
> >
> > Thank you
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/CAL6VdkStOUmBoWb%3DD3cgVpGnDaZ2mHKoPHbzy4U8Yjq%2BkxTVwg%40mail.gmail.com
> > 
> > .
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAAGM457ige6J-EsnSSHF7Fuv3Vc9DxF%3DK9jdqP23%3DWyDkgZ5Yg%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20201230231031.lmmzqqxfq5zv7ygv%40topoi.pooq.com.


Re: [racket-users] Racket and Assembly

2020-12-30 Thread Matt Jadud
Hi Daniel,

As a start to answering your question(s), you might try the 2019 ICFP
experience report on rebuilding Racket on top of Chez Scheme is probably a
good place to look.

https://www.cs.utah.edu/plt/publications/icfp19-fddkmstz.pdf

This will give you an overview of the architecture of the language/runtime,
and should serve as a starting point for additional questions.

Cheers,
Matt


On Wed, Dec 30, 2020 at 2:10 PM Daniel Santos 
wrote:

> Hi.
>
> I really want to know is if Racket compiles code directly into assembly?
> Or does it do: Racket -> C -> Assembly ? Or something else ?
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAL6VdkStOUmBoWb%3DD3cgVpGnDaZ2mHKoPHbzy4U8Yjq%2BkxTVwg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAAGM457ige6J-EsnSSHF7Fuv3Vc9DxF%3DK9jdqP23%3DWyDkgZ5Yg%40mail.gmail.com.


[racket-users] Match: non-greedy, and also repeated elements?

2020-12-30 Thread David Storrs
First off, is there a way to make ... in a pattern match non-greedily?
i.e., match as *few* elements as possible instead of as many?

Second, is there a way to make one pattern refer to an earlier pattern in
the same match clause?  Semi-regularly I find myself wanting to do
something like 'match repeated elements' or 'match if items from these two
lists match'.  For example:

(match (list '(a b c) '(d e c))
  [(list (list _ ... x) (list _ ... y))
   #:when (equal? x y)
   'ok]
  [else 'nope])
=> 'ok

(match '(a b c c d)
  [(list _ ... x y _ ...)
   #:when (equal? x y)
   'ok]
  [else 'nope])
=> 'ok

Is there a way to do this without needing a #:when clause?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKoe78-7sBjHu%3DoR6kg4t4xqaTXjOAa1bHoE_G%2BZKpW6%3DTw%40mail.gmail.com.


[racket-users] Racket and Assembly

2020-12-30 Thread Daniel Santos
Hi.

I really want to know is if Racket compiles code directly into assembly?
Or does it do: Racket -> C -> Assembly ? Or something else ?

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL6VdkStOUmBoWb%3DD3cgVpGnDaZ2mHKoPHbzy4U8Yjq%2BkxTVwg%40mail.gmail.com.


Re: [racket-users] Split-pane editing

2020-12-30 Thread Laurent
On Wed, Dec 30, 2020 at 11:38 AM John Kemp 
wrote:

> I have recently been trying to do this too, as it looks like DrRacket
> *should* allow this…
>
> On Dec 30, 2020, at 4:45 AM, Laurent  wrote:
>
> in DrRacket you can hit View|Split, and you can split multiple times.
>
>
> That’s true, but that doesn’t seem to result in the same behavior as
> emacs, where it is possible to view two different files side-by-side,
> rather than one file of definitions in one pane, and the ‘interactions’ in
> the other pane. I can hide the interactions, but then I seem to have two
> panes which can only display the same functions and which scroll together,
> making even looking at two different functions in the same file, impossible
> (AFAICT).
>

The OP was about splitting the same file. And in DrRacket, you can scroll
the two panes independently.

If you want to look at 2 different files, a workaround is to open 2
DrRacket windows and put them side by side.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaHcEUqhNGbtXBPoX0eGVL15E5xfijShuiQq3OG1nDgs1w%40mail.gmail.com.


Re: [racket-users] Split-pane editing

2020-12-30 Thread John Kemp
I have recently been trying to do this too, as it looks like DrRacket *should* 
allow this…

> On Dec 30, 2020, at 4:45 AM, Laurent  wrote:
> 
> in DrRacket you can hit View|Split, and you can split multiple times.

That’s true, but that doesn’t seem to result in the same behavior as emacs, 
where it is possible to view two different files side-by-side, rather than one 
file of definitions in one pane, and the ‘interactions’ in the other pane. I 
can hide the interactions, but then I seem to have two panes which can only 
display the same functions and which scroll together, making even looking at 
two different functions in the same file, impossible (AFAICT).

- johnk

> 
> On Tue, Dec 29, 2020 at 10:53 PM Hendrik Boom  > wrote:
> When editing code in emacs, I oftern split the pane so I have views on two 
> parts of a 
> file.
> Typically, this is so I can see a function definition in one pane at the same 
> time as I  
> see a corresponding function application in another pane.
> Sometimes, this escalates to three panes.
> 
> Is there any way to do something similar in drracket?
> 
> -- hendrik
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20201229225319.jtxd73vfv4zxok2j%40topoi.pooq.com
>  
> .
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CABNTSaGe9pzYig4bBjfVA5YJH5u%2BA%2Bn5OQVwE5fdqNWEAXR5tQ%40mail.gmail.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/6D8FF830-752C-4459-A55B-63D5E4184EBA%40gmail.com.


Re: [racket-users] Split-pane editing

2020-12-30 Thread Laurent
in DrRacket you can hit View|Split, and you can split multiple times.

On Tue, Dec 29, 2020 at 10:53 PM Hendrik Boom 
wrote:

> When editing code in emacs, I oftern split the pane so I have views on two
> parts of a
> file.
> Typically, this is so I can see a function definition in one pane at the
> same time as I
> see a corresponding function application in another pane.
> Sometimes, this escalates to three panes.
>
> Is there any way to do something similar in drracket?
>
> -- hendrik
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/20201229225319.jtxd73vfv4zxok2j%40topoi.pooq.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaGe9pzYig4bBjfVA5YJH5u%2BA%2Bn5OQVwE5fdqNWEAXR5tQ%40mail.gmail.com.


Re: [racket-users] Re: Dynamic-place PR

2020-12-30 Thread nate
The pr was merged. I don’t know why I didn’t just comment on it.

> On Dec 29, 2020, at 8:25 AM, br...@lojic.com  wrote:
> 
> Maybe ask on https://groups.google.com/g/racket-dev ?
> 
>> On Wednesday, December 9, 2020 at 10:41:51 AM UTC-5 na...@manicmind.earth 
>> wrote:
>> Hello. 
>> 
>> Is the PR #3518 “Create `racket/place/dynamic` to reduce dependencies.” 
>> going to happen? 
>> 
>> I was trying to use ‘#%place and its `dynamic-place` but realized i have to 
>> do some management of streams, i think. 
>> 
>> Nate
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/70c39af4-0da0-4ad3-9802-5c557edecfb6n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/7B0D68B4-1695-4308-8E8B-B63D9A0A234A%40manicmind.earth.


Re: [racket-users] Re: Scribble markdown renderer: tables

2020-12-30 Thread Dominik Pantůček
My impression is that the table generated by markdown render mixin is
not a markdown table.

This is what I get:

ONE  two  3
TWO  three111
THREEone  222

From:

(tabular
 (list
  (list "ONE" "two" "3")
  (list "TWO" "three" "111")
  (list "THREE" "one" "222")))

Also if you look at the actual line strings:

"ONE  two  3"
"TWO  three111  "
"THREEone  222  "

I know it might sound silly, but to me it looks like the table
delimiters are just omitted in the code[1] and judging from the file
commit history, it looks like the tables are rendered on purpose this
way - but they are supposed to be wrapped inside ```/```racket blocks.
Which they aren't in this case.

The problem might be, that the markdown specification for tables
requires them to have the separator row and assumes first line to be the
heading line. While scribble tables are more LaTeX-like and do not make
any assumptions.

I hacked together a VERY ugly awk post-processing pass to solve the one
(and only one) table that I need to render properly. However it seems to
me that having better markdown table support might be beneficial for
others as well.

My proposal is:

Add the tabular delimiters ("| ", " | ", and " |") to the output and
generate the separator row immediately after the first row of data.

Is it too radical or should I patch the markdown renderer and send a PR?



[1]
https://github.com/racket/scribble/blob/master/scribble-lib/scribble/markdown-render.rkt#L94

On 30. 12. 20 1:14, Alex Harsanyi wrote:
> 
> I am not entirely sure what it is that is not working, so I am just
> guessing here:
> 
> * If you are generating Markdown files that contain tables, you need to
> be aware that tables need to be in column 0 (i.e. NOT indented).  If
> they are indented, they will be rendered as pre-formatted text.
> * If you are using the `markdown` package to parse Markdown file, it
> does not support tables.  You either need to merge  Add support for
> table by antoineB · Pull Request #56 · greghendershott/markdown
> (github.com)  , or
> use the `markdown-ng` package.
> 
> Hope this helps,
> Alex. 
> 
> On Tuesday, December 29, 2020 at 10:17:21 PM UTC+8
> dominik@trustica.cz wrote:
> 
> Hello Racketeers,
> 
> back from my procrastination projects to work :)
> 
> In the biggest project our company is working on right now, we use
> Racket HTTP/REST backend and React.js frontend. The whole backend is
> fully contracted - even all the actual servlets that are exposed via
> HTTP are contracted. And in addition to it, they are all fully
> documented using scribble/srcdoc.
> 
> I am using some syntax trickery to generate a table of API calls, so
> that the frontend developers can easily find the right
> documentation. It
> is just a transformation of dispatch-case to scribble tabular
> procedure.
> 
> With PDF output, it works like a charm. With markdown, the tables get
> rendered as fixed-width columns - but it is still a plain text. No
> markers, nothing.
> 
> Just to complete the picture, we are using CI/CD to automatically
> update
> project's Gitlab wiki.
> 
> Am I missing something, or the markdown renderer produces incorrect
> output and I should fix it?
> 
> Any hints will be VERY appreciated as the frontend is developed mostly
> by non-programmers, so it would really help to have everything they
> need
> in one interface (CI pipeline results, issues tracking, backend
> documentation).
> 
> 
> Cheers,
> Dominik
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/7d0d585f-0191-47ea-8979-ccbf71cf7a18n%40googlegroups.com
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/1784e20e-2e6b-ca88-cb37-cb226c2725b5%40trustica.cz.