Re: [racket-users] student produces absolutely bonkers environment lookup code

2021-05-13 Thread 'John Clements' via Racket Users
Yep, I think that’s probably on the money. I guess this is really a classic 
example of the problem with writing code using internet search.

Many thanks!

> On May 7, 2021, at 4:38 PM, Ben Greenman  wrote:
> 
> On 5/7/21, Shu-Hung You  wrote:
>> Not that I have any idea of what's going on, but interestingly, Typed
>> Racket's second ->* example has (1)(3)(4). The use of list* may be
>> possible if one follows the type (List* String Natural x) in the
>> example.
>> 
>> https://docs.racket-lang.org/ts-reference/type-ref.html?#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._-~3e%2A%29%29
>> 
>> Shu-Hung
> 
> +1, that example in the docs looks _very_ similar to the student code
> 
> -- 
> 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/CAFUu9R4SJ7OisUeH5mFxGHpycrxhKYNFuSMLLgSzKCprt2aQWQ%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/36e88c8e-d2eb-43b5-8a8d-4144487fe347%40mtasv.net.


Re: [racket-users] Help in understanding 'letrec' example

2021-05-13 Thread David Storrs
Incidentally, a more concise way of doing this would be:

(define target (build-path "tarzan")) ; convert to path only once
(for/or ([item (in-directory "/tmp/test")]) ; or whatever directory you
want to start in
  (equal? target (file-name-from-path item)))

On Sat, May 8, 2021 at 3:50 AM Utkarsh Singh 
wrote:

> Hi,
>
> First of all I would like to thank Racket community for creating and
> maintaining top quality documentation at https://docs.racket-lang.org/
> and even providing a local copy for it.
>
> Currently I am having some difficulties in understanding this letrec
> example from Racket Guide docs
> (
> https://docs.racket-lang.org/guide/let.html#%28part._.Recursive_.Binding__letrec%29
> ):
>
> (letrec ([tarzan-near-top-of-tree?
>   (lambda (name path depth)
> (or (equal? name "tarzan")
> (and (directory-exists? path)
>  (tarzan-in-directory? path depth]
>  [tarzan-in-directory?
>   (lambda (dir depth)
> (cond
>   [(zero? depth) #f]
>   [else
>(ormap
> (λ (elem)
>   (tarzan-near-top-of-tree? (path-element->string elem)
> (build-path dir elem)
> (- depth 1)))
> (directory-list dir))]))])
>   (tarzan-near-top-of-tree? "tmp"
> (find-system-path 'temp-dir)
> 4))
>
> Problem:
> I having some problem on how recursion is working here and what is the
> problem we are solving here.  Are we finding a file with (name?
> "tarzan") or something else?
>
> --
> Utkarsh Singh
> http://utkarshsingh.xyz
>
> --
> 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/87h7jdslzh.fsf%40gmail.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/CAE8gKodbqAe6DB1rBKBckDWST6f75OV4_35-dcceR7neNfHuaA%40mail.gmail.com.


Re: [racket-users] Is there a good Racket DSL alternative to Image Magick?

2021-05-13 Thread David Storrs
On Wed, May 12, 2021 at 9:21 PM Ben Greenman 
wrote:

> On 5/12/21, Robert Haisfield  wrote:
> > Daniel, that's awesome. How would I filter down this list according to
> the
> > regex?
> >
> > (define list-of-files (map path->string (directory-list starting-path)))
>
> You can wrap it in a filter:
>
>   (define list-of-files (filter (lambda (str) (regexp-match? "\\.png$"
> str)) (map path->string (directory-list starting-path
>

Alternatively, if you would like to keep them as paths instead of strings
then you can do this:

(filter (compose1 (curry regexp-match? "\\.png$") path->string)
(directory-list "."))


Also, if you're going to be doing a lot of work with regexen, take a look
at the at-exp reader so that you don't have to do so much backwhacking
(obviously it's not important in this case where there's only one character
to escape, but it gets helpful as you do more):

#lang at-exp racket
(filter (compose1 (curry regexp-match? @~a{\.png}) path->string)
(directory-list "."))

-- 
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/CAE8gKoe1Nrx%3DU9draN1q%2BokxefrPvH%3D0tq3B8rL5hwAKpXOPRQ%40mail.gmail.com.


[racket-users] preview of a cross-compilation tool

2021-05-13 Thread Matthew Flatt
While `raco exe` in v8.1 very nearly supports cross-builds of Racket
executables[*], it's not easy to pass the right flags and set up the
needed target-platform distributions.

The `raco cross` command provided by the new "raco-cross" package wraps
Racket tools to simplify all of that management. For example,

  raco cross  --target x86_64-linux --vm bc  exe example.rkt

is like running

  raco exe example.rkt

but it cross-builds for x86_64 Linux. That build process involves
downloading a minimal racket tarball for the target platform,
installing "compiler-lib" there, downloading a matching minimal build
of Racket for the host platform, and then running the host Racket in
cross-build mode with installed target distribution --- but, again,
`raco cross` takes care of all that.

Just like using `raco exe` on Linux, the generated executable won't
actually work on other machines until you package it in a distribution
using `raco dist`:

  raco cross  --target x86_64-linux --vm bc  dist example-dist example

Naturally, this second invocation of `raco cross` for the same target
uses the installations prepared by the first `raco cross`, so it's
relatively fast.


I expect that `raco cross` will become more useful after the v8.2
release, which will repair cross-compilation for CS executables and
executables with native libraries (like GUI executables). Meanwhile,
it's possible to use `raco cross` with snapshot builds, but you have to
point it at a snapshot site; see the documentation for more
information.


Because juggling multiple installations and versions is a lot of the
work for cross-compilation, `raco cross` can also be a way to get to a
different version of Racket in minimal form. For example,

  raco cross --version 8.0 racket

starts a Racket v8.0 prompt. (The `racket` command is treated specially
by `raco cross`. All other commands are prefixed by `raco`.)


For more information see

  https://docs.racket-lang.org/raco-cross/index.html


[*] Running a cross-built CS executable fails at the very last step of
startup, and that's due to an expander bug for handling top-level
`begin` forms compiled in machine-independent form. We didn't
detect this problem before, because it wasn't part of Bogdan's use
case for cross builds, and because cross-compilation was painful
enough that we didn't actually try other cases.

-- 
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/20210513095436.31b%40sirmail.smtps.cs.utah.edu.


[racket-users] CFP: SLE 2021 - 14th ACM SIGPLAN International Conference on Software Language Engineering

2021-05-13 Thread Andrei Chis

14th ACM SIGPLAN International Conference on Software Language Engineering 
(SLE 2021)
October 17-19, 2021 
Chicago, Illinois


https://conf.researchr.org/home/sle-2021
http://www.sleconf.org/2021
Follow us on twitter: https://twitter.com/sleconf


We are pleased to invite you to submit papers to the 14th ACM SIGPLAN 
International Conference on Software Language Engineering (SLE 2021), held 
in conjunction with SPLASH, GPCE and SAS 2021. Based on the future 
developments the conference will be hosted in Chicago, Illinois, United 
States on October 17-19, 2021 or will be held as a virtual event.

---
Scope
---

The ACM SIGPLAN International Conference on Software Language Engineering 
(SLE) is devoted to the principles of software languages: their design, 
their implementation, and their evolution.

With the ubiquity of computers, software has become the dominating 
intellectual asset of our time. In turn, this software depends on software 
languages, namely the languages it is written in, the languages used to 
describe its environment, and the languages driving its development 
process. Given that everything depends on software and that software 
depends on software languages, it seems fair to say that for many years to 
come, everything will depend on software languages.

Software language engineering (SLE) is the discipline of engineering 
languages and their tools required for the creation of software. It 
abstracts from the differences between programming languages, modelling 
languages, and other software languages, and emphasizes the engineering 
facet of the creation of such languages, that is, the establishment of the 
scientific methods and practices that enable the best results. While SLE is 
certainly driven by its metacircular character (software languages are 
engineered using software languages), SLE is not self-satisfying: its scope 
extends to the engineering of languages for all and everything.

Like its predecessors, the 14th edition of the SLE conference, SLE 2021, 
will bring together researchers from different areas united by their common 
interest in the creation, capture, and tooling of software languages. It 
overlaps with traditional conferences on the design and implementation of 
programming languages, model-driven engineering, and compiler construction, 
and emphasizes the fusion of their communities. To foster the latter, SLE 
traditionally fills a two-day program with a single track, with the only 
temporal overlap occurring between co-located events.

---
Topics of Interest
---

SLE 2021 solicits high-quality contributions in areas ranging from 
theoretical and conceptual contributions, to tools, techniques, and 
frameworks in the domain of software language engineering. Broadly 
speaking, SLE covers software language engineering rather than engineering 
a specific software language. Topics of interest include, but are not 
limited to:


* Software Language Design and Implementation
  - Approaches to and methods for language design
  - Static semantics (e.g., design rules, well-formedness constraints)
  - Techniques for specifying behavioral / executable semantics
  - Generative approaches (incl. code synthesis, compilation)
  - Meta-languages, meta-tools, language workbenches

* Software Language Validation
  - Verification and formal methods for languages
  - Testing techniques for languages
  - Simulation techniques for languages

* Software Language Integration and Composition
  - Coordination of heterogeneous languages and tools
  - Mappings between languages (incl. transformation languages)
  - Traceability between languages
  - Deployment of languages to different platforms

* Software Language Maintenance
  - Software language reuse
  - Language evolution
  - Language families and variability

* Domain-specific approaches for any aspects of SLE (design, 
implementation, validation, maintenance)

* Empirical evaluation and experience reports of language engineering tools
  - User studies evaluating usability
  - Performance benchmarks
  - Industrial applications

---
Important Dates
---

All dates are Anywhere on Earth.

* Mon 5 Jul 2021 - Abstract Submissions
* Fri 9 Jul 2021 - Paper Submissions
* Wed 1 Sep 2021 - Review Notification
* Wed-Fri 1-3 Sep 2021 - Author Response Period
* Mon 13 Sep 2021 - Notification
* Wed 15 Sept 2021 - Artifact Submissions
* Tue 28 Sep 2021 - Artifact Kick-the-tires Author Response 
* Tue 12 Oct 2021 - Artifact Notification
* Sun-Tue 17-19 Oct 2021 - SLE Conference

---
Types of Submissions
---

SLE 2021 solicits three types of