Re: [racket-users] I made some videos about Racket (a.k.a the return of Playing the Game with PLT Redex)

2021-01-05 Thread Leandro Facchinetti
Thanks to everyone who responded (privately and otherwise) for the nice 
words.

Sage Gerard: To each its own. I’m glad to hear that you have these success 
cases with Racket 

-- 
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/ae894452-fb5c-45c1-86f1-f6b228a3c73dn%40googlegroups.com.


[racket-users] I made some videos about Racket (a.k.a the return of Playing the Game with PLT Redex)

2021-01-03 Thread Leandro Facchinetti
Hi all,

Here are the videos:

Playing the Game with PLT Redex: https://youtu.be/NszLQNROdw0
Understanding the Type of call/cc: https://youtu.be/7Zkt_IJaYOY
Racket: Why I Think It’s a Great Language, and Why I’m Not Using It 
Anymore: https://youtu.be/_wY7FBtr7_c

The first two used to be articles on my website (https://leafac.com), but I 
changed the way the website is built and took them down. From time to time 
people ask me about it, so here it is, in video form.

I hope you like it.

Best.

-- 
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/16cbbdc6-63e6-4f78-8862-76f7ff52ec01n%40googlegroups.com.


Re: [racket-users] Racket Week’s website looks strange now that the registration is open

2019-02-01 Thread 'Leandro Facchinetti' via Racket Users
> It's decrementing, isn't it? It just says since how long it's open I guess :)

Yes, I mistyped—it’s decrementing.

I think you should be saying “Registration is open «Link for registration»”.

-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Weird behavior when a ‘set’ is the result of ‘eval’

2019-01-10 Thread 'Leandro Facchinetti' via Racket Users
 Got it. Thanks.
-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Weird behavior when a ‘set’ is the result of ‘eval’

2019-01-10 Thread 'Leandro Facchinetti' via Racket Users
Please help me understand the following:

#lang racket
(define s (eval '(begin (require racket/set) (set 1 2)) (make-base-namespace)))
s ;; ⇒ (set 1 2)
(set? s) ;; ⇒ #f (but I expected ‘#t’)

-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] The performance of ‘set’ vs. lists+‘remove-duplicates’

2018-12-06 Thread 'Leandro Facchinetti' via Racket Users
In my program, hashes are only 20% faster than sets containing approximately 20 
elements that are S-expressions.

I solved the mystery of why switching to lists with unique elements made things 
faster and in some cases even changed the meaning of the program. I always 
thought that my program would add the elements to the sets in the same order 
every time, so lists with unique elements would be equivalent to sets. It turns 
out that I was wrong. Case closed.
-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] The performance of ‘set’ vs. lists+‘remove-duplicates’

2018-12-05 Thread 'Leandro Facchinetti' via Racket Users
The sets are about 20 elements in size.

It seems that ‘member’ before ‘cons’ is marginally faster than 
‘remove-duplicates’ after ‘cons’, as one would expect.

But it’s the strangest thing: in some cases switching from sets to lists with 
unique elements changes the meaning of the program! I spent the whole morning 
looking at the same 15 lines of code and I still have no idea why. All data is 
immutable. The sets/lists-with-unique-elements are used to build lists—`(___ 
,my-set ___)—which are then used as keys/values in hashes. I ‘hash-union’ these 
hashes. Nothing unusual.

I’m going to keep investigating…
-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] The performance of ‘set’ vs. lists+‘remove-duplicates’

2018-12-04 Thread 'Leandro Facchinetti' via Racket Users
I rewrote a codebase that was using ‘set’s to use lists that I 
‘remove-duplicates’ whenever I ‘cons’. The result is orders of magnitude 
faster. Do you have any idea why?

-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Criação dinâmica de perguntas

2018-10-02 Thread 'Leandro Facchinetti' via Racket Users
O código que você mostrou primeiro cria uma variável chamada que com valor 
inicial "questao_solve" (uma string). Depois a variável que tem o valor 
mudado para um radio-box% (um objeto). Perceba que questao_solve nunca foi 
uma variável, então tentar mandar a mensagem get-value para ele resulta em erro.

Talvez o que você precise seja uma estrutura de dados (uma lista, um 
dicionário, ou algo do gênero), que contenha todos os questao_solve indexados 
por número.

-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Playing the Game with PLT Redex · Second Edition

2018-09-30 Thread 'Leandro Facchinetti' via Racket Users
Hi Racketeers,

I while ago I wrote a short article in which I used PLT Redex to play a game of 
Peg Solitaire. I now present you the extended version of that article:

https://www.leafac.com/prose/playing-the-game-with-plt-redex/ 
<https://www.leafac.com/prose/playing-the-game-with-plt-redex/>

The short and to-the-point version still exists in the form of an introduction: 
https://www.leafac.com/prose/playing-the-game-with-plt-redex/introduction 
<https://www.leafac.com/prose/playing-the-game-with-plt-redex/introduction>

But now I also dive into a few PLT Redex forms in more detail. I consider this 
to be a better bridge between knowing little about programming-language theory 
and being able to follow more advanced material, for example, the excellent 
SEwPR.

I welcome feedback.

Thank you for your time.

-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] ‘with-limits’ doesn’t stop subprocesses

2018-08-05 Thread 'Leandro Facchinetti' via Racket Users
Hi,

I want to run a subprocess with a timeout. Here’s what I tried:

#lang racket
(require racket/sandbox)

(with-handlers ([exn:fail:resource? (λ (e) (displayln "Timed out"))])
  (with-limits 5 #f (system "sleep 10 && echo Finished")))

This doesn’t work, it prints both “Timed out” after 5 seconds and “Finished” 
after 10 seconds. I wish ‘with-limits’ would stop the underlying process, so 
I’d never see “Finished”. How should I do that?

Thank you.

-- 
Leandro Facchinetti 
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-16 Thread 'Leandro Facchinetti' via Racket Users
As far as I understand, your ‘length-ok’ is implementing in Redex the ‘(<= 
(length ___) ___)’ I had in my ‘side-condition’. But I can’t see how it 
addresses two important features from my original code: (1) ‘k’ is 
parameterizable, and its value influences whether a list is valid or not; 
and (2) the non-terminal ‘t’ could appear in patterns, for example, in a 
metafunction contract. This last one is essential, because using ‘t’ in a 
contract enforces a data structure invariant—‘t’ can’t be longer than 
‘k’—and I can’t trust all callers of my metafunctions to check ‘length-ok’ 
themselves. In some cases, they wouldn’t even be able to do it; for 
example, suppose ‘t’ is part of the ‘domain’ of a ‘reduction-relation’ and 
I use it with ‘apply-reduction-relation*’, then there’s no way to access 
intermediary states and check if they preserve the invariant.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-16 Thread 'Leandro Facchinetti' via Racket Users


> But I clearly don’t get what you really want so I will abandon this one. 
>
> Good luck — Matthias 
>

Thanks for trying, talking to you is always instructive 

For people that hasn’t abandoned this one: I decided to bite the bullet and 
thread the ‘metaparameter’ in my definitions. This will allow me to 
re-enable the cache, and I’m interested in measuring how this impacts 
performance. (I’m not benchmarking these models, I know that isn’t Redex 
purpose, but there are some small programs that are beyond the reach of my 
models because they take too long to complete.) In the process I found a 
case that I can’t express: in my language definition I have a production 
that means “a list of maximum size ‘k’”, which I express with a 
side-condition. There is no way to *thread parameters* into ‘redex-match?’ 
and pattern matching in general, so I have to turn off this verification.

The problem below is a minimal working example to illustrate my use case. 
Either I have to remove the ‘side-condition’ for ‘t’ or turn off the cache:

#lang racket
(require redex)

(define k (make-parameter 0))

(define-language L
  [t ::= (side-condition (name t [_ ...]) (<= (length (term t)) (k)))])

(caching-enabled? #f)

(displayln (redex-match? L t (term []))) ;; => #t
(displayln (redex-match? L t (term [a]))) ;; => #f
(displayln (redex-match? L t (term [a b]))) ;; => #f

(parameterize ([k 1])
  (displayln (redex-match? L t (term []))) ;; => #t
  (displayln (redex-match? L t (term [a]))) ;; => #t
  (displayln (redex-match? L t (term [a b]))) ;; => #f
  )

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-15 Thread 'Leandro Facchinetti' via Racket Users


> Robby’s message dominates mine but I don’t get why you can’t work your way 
> thru what I provided. 
>

I don’t see the connection between the issue I brought up and what you 
provided. In your program ‘r-r/tick’ is a form to define a reduction 
relation which manages ‘clock’, but then ‘clock’ can’t determine the 
behavior of the reduction relation (and it isn’t cached by Redex). Note 
that ‘r-r/tick’ says ‘(where _ ,(begin (set! clock (u clock)) (o clock)))’, 
which means the outputs of the ‘observer’ are ignored. Now, we could modify 
‘r-r/tick’ to take a pattern ‘p’ and say ‘(where p ,(begin (set! clock (u 
clock)) (o clock)))’. But then we’re getting further and further away from 
my intent: having ‘k’ as an implicit argument to a collection of 
definitions (metafunctions, judgment forms, and so forth), beyond a single 
reduction relation.
 

> HUH? This is something that you control with the initialization function. 
> The REDEX results are the same. It is up to your init function to cache or 
> not cache. 


But if my function doesn’t cache and the reduction relation depends on 
‘clock’ (see previous paragraph), then the Redex results would differ.
 

> > No, ‘#:initial’ let’s you parameterize ‘clock’ when *defining* the 
> reduction relation (‘r-r/tick’), not when *calling* it (‘traces’, 
> ‘apply-reduction-relation’ and friends). 
>
>
> Really? 
>
> (define *foo 0) 
> (define (init) .. *foo ..) 


I assume you’re proposing to pass ‘init’ to ‘#:initial’, and then ‘(set! 
*foo ___)’ to control the reduction relation’s behavior. And that starts to 
look like a dynamically bound variable—better yet, a Racket parameter. 
We’re on the right track: Racket parameters is how we got started, and I’m 
proposing we need them at the Redex level as well 
 

> > (define-metafunction X 
> >   [(my-metafunction _) clock]) ;; <= ‘clock’ is just a symbol here, not 
> a bound (meta-)variable 
>
>
> What does this even mean? Racket-Redex is about variables not symbols. 


Right, Racket–Redex is about variables, but ‘clock’ in ‘my-metafunction’ 
 isn’t a variable, it’s literally the symbol ‘'clock’.

* * *

I feel we’re getting into the weeds and having different conversations. Can 
I kindly ask you re-read my original message with a fresh pair of eyes?

By the way: *thank you all* for the conversation thus far, and for building 
Redex in the first place. As usual I’m learning a lot from interacting with 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-15 Thread 'Leandro Facchinetti' via Racket Users


> Stepping back a little bit here, if you were to write this down in a 
> way that were to make sense to a reader of a paper, how would you 
> communicate with them how/when this parameter changes? 
>

When defining metafunctions/reduction relations/judgment forms and so on, 
authors generally say something to the effect of “this forms a family of 
analyses parameterized over a choice of ‘k’; we may elide ‘k’ where it’s 
implicit.” Alternatively, sometimes ‘k’ appears as a sub/superscript on the 
metafunction name, for example, ‘firstₖ(list)’. In this case, the role of 
‘k’ as a parameter is more evident, but it’s special, justifying the 
special notation and sometimes even omission.

Then, to parameterize ‘k’, I can show you one example from the same line of 
research I cited in the original message: 

Gilray, Thomas, Steven Lyde, Michael D. Adams, Matthew Might, and David Van 
Horn. 2016. “Pushdown Control-Flow Analysis for Free.” In Proceedings of 
the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming 
Languages, 691–704. POPL ’16. New York, NY, USA: ACM. 
https://doi.org/10.1145/2837614.2837631.



I also have a couple from my own work, which are even more explicit:



 

> I think we've already agreed that one can think of the entire paper 
> and its development having exactly one choice of `k` made at the very 
> beginning, and I think we agree Redex can support that using something 
> like define-term (so you have to click "run" to change the parameter). 


> That clearly has some advantages because you never conflate two parts 
> of the model that come with different values of `k`. That said, it is 
> pretty clunky. 
>


That’s half-way there, yes. But it wouldn’t hurt to have a ‘parameterize’ 
form that percolates a different value through the rest of the model, like 
a dynamically bound variable. Say we’re developing a adaptive analysis that 
tweaks ‘k’ according to some policy: ‘my-policyₖ(…) = firstₖ₊₁(…) if 
condition-holds’. Now all forms called by ‘first’ have access to the new 
‘k+1’.

Aside: I know this special typesetting of ‘k’ can be accomplished with 
rewrite rules for ‘lw’. That’s beyond my concern: I’m interested in being 
able to *elide* ‘k’ when it doesn’t matter.

 

>
> Here is a second idea: what if you did this: 
>
> (define-language L 
>   (k ::= 1) 
>   ...all the other stuff...) 
>
> and we tweaked Redex in some way so that definitions like that could 
> be used not just in pattern positions, but also in term positions 
> (since there is only only possibility for `k`, after all). 
>
> THEN, with that definition we could use define-extended-language and 
> define-extended-metafunction and friends to change the value of `k`. 
> This has its own clunkyness, but it is a clunkyness that we have 
> seriously thought about and for which there are plans to do better 
> (basically designing a module system for Redex). 
>
> Is this a fruitful path to follow? 
>

 Hmmm, clunckyness for clunckyness I think I’d prefer to bite the bullet 
and thread ‘k’ instead of extending all my definitions.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-15 Thread 'Leandro Facchinetti' via Racket Users
This is going further in the wrong direction 

1. The cache for the reduction relation is invalid.

2. There’s no way to parameterize ‘clock’ when calling the reduction 
relation (I think it’d really help to think of ‘k’ instead of ‘clock’).

3. ‘clock’ isn’t available to metafunctions called from the reduction 
relation.

You see, my interest is not to hide side-effects from the definition of the 
reduction relation, but to have implicit parameters in all kinds of 
definitions.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-15 Thread 'Leandro Facchinetti' via Racket Users
I see how this makes typesetting work. But I’m sorry but I don’t see how 
this program addresses any of my concerns: ‘clock’ is still unavailable to 
when defining ‘go’; and worse, there’s no way to set it from the outside.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users
Thanks for the clarification, I think I understand your proposal. And I see 
three problems:

1. I believe ‘traces/t’ is the evidence of the issue I brought up 
earlier: How do call sites know the form expects the extra argument? As 
your example demonstrates, call sites need to be explicit about the extra 
argument. This becomes a global transformation in the model, which is 
doable with macro wizardry, but isn’t convenient and doesn’t look like what 
you’d see on a paper.

2. The thing I’m calling ‘metaparameter’ (in your example, ‘ticks’) needs 
to be available for the definition of the reduction relation. Instead of 
‘(--> a b)’, think ‘(--> a b (side-condition (> ticks 10)))’. In your first 
example ‘ticks’ is in scope, but it suffers from the caching problem from 
my original message. In your second example ‘ticks’ isn’t in scope, and 
introducing it would be unhygienic.

3. Most important of all: the ‘metaparameter’ needs to be available through 
several definitions. Maybe the reduction relation calls a metafunction, 
which calls a judgment form, which calls a relation defined with 
‘define-relation’, and they all might or might not depend on the 
‘metaparameter’.

Bonus issue: typesetting this is probably hard.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users


A related question is 
> to ask if maybe the parameter is intended to be so "dyanmic". Maybe 
> you should have to recompile the redex program to change the parameter 
> sometimes because, after all, if runs of the abstract machine with 
> different values of `k` interact with each other, maybe nothing makes 
> sense. 
>

Yes, I agree that runs of the abstract machine with different values of ‘k’ 
should be distinct and disallowed to interact.

One thing I do often is interact with the model in the REPL: “Is ‘k = 1’ 
enough to capture a certain property of this program?” “How about ‘k = 2’?” 
And so forth. It sounds like having to recompile the model to change the 
parameter would not be compatible with this kind of exploration, in which 
case I don’t like the idea.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users


> What if you wrote macros over reduction-relation instead of the exact 
> model? These macros could implement threading and hide it. They would kind 
> of be like monads here. — Matthias 
>

Do you mean something like

(define-parameterized-metafunction (k) L
 tick : e _ _ _ t -> t
 [(tick e _ _ _ t) ,(take (cons (term e) (term t)) k)])

which would expand to

(define-metafunction L
 tick : e _ _ _ t _ -> t
 [(tick e _ _ _ t k) ,(take (cons (term e) (term t)) k)])

?

How would the call sites of the metafunction know it expects the extra 
argument?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users


> Yes, it looks like the original cache is just re-installed when re-enabled.
>
> Perhaps there should be an operation provided by Redex to clear away the 
> cache.
>

That’s one my proposals, yes  (see § Solutions on my original message)

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users

First, thanks for the reply. It’s valuable to have the author of the paper 
from where I draw my example chime in 

1) Instead of turning the cache off completely, you could just

invalidate the cache when the parameter changes, i.e. write a `set-k!'

function that updates the parameter and toggles the cache off and back
on (I assume this will clear it out).


I believe the following program proves your assumption wrong:

* * *

#lang racket/base

(require redex/reduction-semantics racket/list)

(define k (make-parameter 0))

(define-language L
 [e ::= any]
 [t ::= [e ...]])

(define-metafunction L
 tick : e _ _ _ t -> t
 [(tick e _ _ _ t) ,(take (cons (term e) (term t)) (k))])

(term (tick a _ _ _ [])) ;; => '()
(parameterize* ([k 1]
   [caching-enabled? #f]
   [caching-enabled? #t])
 (term (tick b _ _ _ []))) ;; => '(b)
(parameterize ([k 1]
  [caching-enabled? #f]
  [caching-enabled? #t])
 (term (tick a _ _ _ []))) ;; => '()

* * *

If the cache was flushed, then we’d see ‘'(a)’ instead of ‘'()’ in the last 
term.

As I pointed out in my original message: cache invalidation continues to be 
one of the *hard problems* in computer science.

3) Move the escaping ellipses to the outermost `begin' form.  This

allows you to write the escape once instead of for each Redex ellipse.

It also means the code within the macro definition looks more like the
original.


That is one step in the right direction. Thanks for the suggestion. But I 
still think macro-defined models are not the right abstraction here.

-- 
Leandro Facchinetti <m...@leafac.com>
https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] [Shameless self-promotion] Articles about programming-language theory for working programmers in Racket

2017-04-10 Thread Leandro Facchinetti
Hi Matthias,

I am replaying publicly to thank you for the kind words, they surely
motivate me to keep going! :)
-- 
Leandro Facchinetti <lfacc...@jhu.edu>
https://www.leafac.com
GPG: 0x5925D0683DF3D583

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] [Shameless self-promotion] Articles about programming-language theory for working programmers in Racket

2017-04-08 Thread Leandro Facchinetti
Hi Matthias and Vincent,

First, thank you for your time reading the article and writing your
feedback.

> Matthias Felleisen wrote:
>
> Leandro,
>
> Before I say anything else, I really enjoyed your "playing the game
> with plt redex”...

Thank you for the kind words :)

> Your new essay [...] show[s] how to take a program in Racket down to
> one in a by-value version of Lambda Calculus. Why stop there?

I didn’t:
https://www.leafac.com/prose/programming-language-theory-explained-for-the-working-programmer--principles-of-programming-languages/#the-essence

> Do we really need to go through all of this to explain that “creating
> programs so that our successors can read them” is the purpose of a
> language?

“Creating programs so that our successors can read them” is an important
takeaway from the article, but it isn’t the major one. The main point is
that data communication is the essence of computation, and, thus, of
programming languages (see the section I linked above). Arbitrary data
communication is the common factor between the Lambda Calculus, SKI
calculus, tag systems, and any other Turing complete system. Maybe this
argument didn’t get across as clearly as I intended, and I’d welcome
suggestions on how to improve this.

But there’s a hidden agenda to this article. Before I got into my
Ph.D. program, I was a working programmer interested in
programming-language theory. I found topics such as Church encoding,
Lambda Calculus and the Halting Problem fascinating. But I couldn’t read
most of the texts on these topics because they used notation and jargon
beyond my understanding.

I got into a Ph.D. program and invested the last three years in learning
how to read through the funny symbols. And I what found were some of the
most interesting ideas in human knowledge. Now I’m writing to myself in
2013, unpacking these ideas in a way that working programmers can
understand.

The article you read is the first in a series, that I’m calling
“Programming-Language Theory Explained for the Working Programmer.” To
this point, this is the only published article in the series, but I’m
already working on the second, which will be about interpretation. Then
the next articles will be about intermediary representations (CPS and
ANF), and program analysis (k-CFA).

Where am I heading with this series? I want to explain my research
(https://pl.cs.jhu.edu/projects/demand-driven-program-analysis/) in
terms that working programmers can understand, bridging the gap between
industry and academia. To explain my research from scratch, I first have
to invent the universe. “Programming-Language Theory Explained for the
Working Programmer” is me inventing the universe.

(Also, it’s an opportunity for me to practice technical writing. English
isn’t my first language and I received consistent feedback that I need
to improve this skill.)

So, language design and the expressive power of programming languages
are interesting topics. But my article isn’t dedicated to exploring
them. The secret is that it was just an excuse to introduce the Lambda
Calculus, which I need to explain program analysis later. Along the way,
there are many interesting ideas, like language design and the
expressive power of programming languages, and that’s why I hint at
those as well.

In any case, your insights about language design and DSLs are much
appreciated. I’m definitely reading the citations you
mentioned. Specially because, when I put by software engineer hat, I’m
entirely in agreement with the Manifesto. I’m an advocate of DSLs myself
:)

I’d love to continue having your feedback on this series. When I have
the next articles ready, can I keep sending them your way? I expect I’ll
have one per month.

Best.
-- 
Leandro Facchinetti <lfacc...@jhu.edu>
https://www.leafac.com
GPG: 0x5925D0683DF3D583

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] [Shameless self-promotion] Articles about programming-language theory for working programmers in Racket

2017-04-04 Thread Leandro Facchinetti
Hi Dave,

First, thank you for your time reading the article and giving feedback
about it. I acknowledged your contribution on the article, if there’s
any URL associated with your name that you’d like me to link, please let
me know. Or, if there’s any reason why you *don’t* want to be
acknowledged, just tell me and I’ll remove it.

> The article is well written in the sense that I had no trouble
> following along and the concepts all made sense, but I think it needs
> some clarification on the meta level.
>
> Although I understood the text of the article I found myself confused
> about its ultimate point.  It started off by talking about the
> "essential features" of a programming language, but did not explain
> why I should care or what I would learn from the paper.  That's fine
> if you're aiming at an academic audience who are focused on
> theoretical concepts, but it doesn't work if your target demographic
> is "all programmers" who are doing "everyday programming".
>
> After the introduction there followed a long section about replacing
> numbers with other representations.  Although I understood *what* was
> being done, I didn't understand *why* it was being done, or what I was
> expected to learn from it.  I found myself skimming, looking for a
> point, and eventually stopped reading partway through in frustration.
>
> There was a paragraph at the beginning that tried to cover this:
>
> "Besides satisfying a curiosity, this article introduces programming
> techniques that are generally applicable in everyday programming. And,
> for people starting in programming-language design and analysis, this
> article introduces a minimal programming language core from which to
> build."
>
> This seemed to mesh poorly with the content of the article; the
> techniques are claimed to be "applicable in everyday programming", but
> there's no way that I'm actually going to use Peano numbers, ever,
> except in an artificial environment such as a theoretical paper or a
> homework assignment.

You’re right in saying that you’re probably never going to directly use
any of the encodings introduced in the article. But I’m sure you can use
some of the techniques behind the encodings. For example, delaying
computations by wrapping them in functions, or receiving functions as
arguments when there isn’t enough information to act. I’d bet you even
use some of these techniques already, and you re-discovered them by
using your intuition. In that case, it’s nevertheless valuable to
identify the patterns, and to understand how they work and how to apply
them in future problems.

The *Conclusion* goes over the whole journey of the article one more
time. It specifically highlights the techniques that are the major
takeaways, and gives more examples of how to use them in different
contexts.

I didn’t go into those tangents in the main matter because I wanted to
avoid loosing focus and, consequently, reader attention. Also, as you
noted, it is a long read already. In any case, do you think the article
would be more appealing to you if I had taken a different approach and
intertwined the encodings with discussions about the underlying
techniques and their uses?

Anyhow, I’m sorry the article frustrated you and that you didn’t finish
reading it. I’m writing more articles and hopefully in the future you
can find one that interests you :)

> As a closing thought, I found the example of bicycle-trip-tracking to
> be excellent -- it clearly delineated the difference between an
> essential feature and a convenience.

Thank you. I’m glad that point came across.

> PS:
> Also, if you'll pardon some really nitpicky stuff, here's a couple
> minor copyedits because I cannot turn off my English major brain:
>
> "satisfy curiosity", not 'satisfying a'
>
> "they use fewer features", not 'less features'. Fewer is for countable
> nouns, less is for mass nouns.  "Fewer features", "less salt".

I fixed the errors you pointed out. Thank you very much. English is not
my first language and I really appreciate the free copy editing :)

Best.
-- 
Leandro Facchinetti <lfacc...@jhu.edu>
https://www.leafac.com
GPG: 0x5925D0683DF3D583

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] [Library Announcement] CSS-expressions, Pollen Component and Extensible Functions

2017-02-13 Thread Leandro Facchinetti
Hi all,

I’m here to announce three packages I published recently, because I want
feedback from the community:

- CSS-expressions: S-expression-based CSS.
  https://docs.racket-lang.org/css-expr/index.html

- Pollen Component: Component-based development for Pollen.
  https://docs.racket-lang.org/pollen-component/index.html

- Extensible Functions: A solution to the expression problem in Typed Racket.
  https://docs.racket-lang.org/extensible-functions/index.html

Thank you.
-- 
Leandro Facchinetti <lfacc...@jhu.edu>
https://www.leafac.com
GPG: 0x5925D0683DF3D583

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Request for comments: An embedded DSL for CSS in Racket

2016-11-14 Thread Leandro Facchinetti
Hi WarGrey Gyoudmon Ju,

I’m happy to know that other people are working on the same space. It
seems like we’re taking different approaches and I’d like to see your
project when you release it.

Best.
-- 
Leandro Facchinetti <lfacc...@jhu.edu>
https://www.leafac.com
GPG: 0x5925D0683DF3D583

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Potential small bugs on SEwPR

2016-06-12 Thread Leandro Facchinetti
Hi, all.

Thanks for the feedback and for the acknowledgment on the Errata
page. And thanks for answering my question about typesetting. I can
confirm that I get small-caps using the provided snippet.

Best.
-- 
Leandro Facchinetti <lfacc...@jhu.edu>
https://www.leafac.com
GPG key: 3DF3D583

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Possible bug in SEwPR, Exercise 15.1

2016-06-02 Thread Leandro Facchinetti
> On the other hand, it would be a real stress test. So if you’re up to
> it, try to use the binding mechanism and post on the list how you’re
> doing. — Matthias

That's my plan as soon as I finish reading SEwPR. I'll let you know how
it goes.

Thanks a lot to you all for all the kind advice.

Best.
-- 
Leandro Facchinetti <lfacc...@jhu.edu>
https://www.leafac.com
GPG key: 3DF3D583

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Possible bug in SEwPR, Exercise 15.1

2016-06-02 Thread Leandro Facchinetti
> Woah, cool!
>
> Since the book was written, we have added support for binding
> specifications to Redex. It's documentation is still in the process of
> being improved, but you might have some interest in checking it out
> (it is the part after #:binding-forms).

I read the documentation and this feature is really impressive. In
particular, I liked that Redex is able to recognize that two terms are
alpha-equivalent!

The way I understood from my first reading, it seems like the binding
feature handles well lexical scoping. Would it be able to support a
language with dynamic scoping?

I ask that because I'm currently working on a language which notion of
scoping is something in between lexical and dynamic.

> Bugs in substitution functions are the worst.

Indeed :)
-- 
Leandro Facchinetti <lfacc...@jhu.edu>
https://www.leafac.com
GPG key: 3DF3D583

-- 
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.
For more options, visit https://groups.google.com/d/optout.