[racket-users] Running Big Bang applications in the browser

2019-09-16 Thread Maciek Godek
Hi,
is there any way to deploy Racket's big-bang applications to run in a 
browser (or any plans to enable that feature)?

-- 
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/8ece7940-39d0-42a6-9ede-1ca2f9b071c1%40googlegroups.com.


Re: [racket-users] Applicable sets and hashes?

2019-09-08 Thread Maciek Godek
Great, thanks!

W dniu niedziela, 8 września 2019 11:57:47 UTC+2 użytkownik ricardo.g.herdt 
napisał:
>
> Hi Maciek, 
>
> yes, it is. Take a look at rackjure: 
>
> https://docs.racket-lang.org/rackjure/index.html#(part._dict-app) 
>
> Regards, 
>
> Ricardo 
>
>
> Am 08.09.2019 11:51 schrieb Maciek Godek: 
> > Hi, 
> > is it possible to take Racket's hash tables and sets, and make them 
> > applicable (like in Clojure)? 
> > 
> > So that, for example 
> > 
> > (#hash((a . 1) (b . 2)) 'a) 
> > 
> > would be equivalent to 
> > 
> > (hash-ref #hash((a . 1) (b . 2)) 'a) 
> > 
> > and 
> > 
> > ((set 1 2 3) 1) 
> > 
> > would be equivalent to 
> > 
> > (set-member? (set 1 2 3) 1) 
> > 
> >  -- 
> >  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...@googlegroups.com . 
> >  To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/racket-users/879ae299-8f3f-4b9a-b13e-16727f347cb8%40googlegroups.com
>  
> > [1]. 
> > 
> > 
> > Links: 
> > -- 
> > [1] 
> > 
> https://groups.google.com/d/msgid/racket-users/879ae299-8f3f-4b9a-b13e-16727f347cb8%40googlegroups.com?utm_medium=email_source=footer
>  
>

-- 
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/c8780d58-ebdf-458b-a3ab-1f93aea109f1%40googlegroups.com.


[racket-users] Applicable sets and hashes?

2019-09-08 Thread Maciek Godek
Hi,
is it possible to take Racket's hash tables and sets, and make them 
applicable (like in Clojure)?

So that, for example

(#hash((a . 1) (b . 2)) 'a)

would be equivalent to

(hash-ref #hash((a . 1) (b . 2)) 'a)

and 

((set 1 2 3) 1)

would be equivalent to

(set-member? (set 1 2 3) 1)


-- 
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/879ae299-8f3f-4b9a-b13e-16727f347cb8%40googlegroups.com.


[racket-users] Re: The case, and a proposal, for elegant syntax in #lang racket2

2019-07-15 Thread Maciek Godek


W dniu niedziela, 14 lipca 2019 19:44:30 UTC+2 użytkownik cwebber napisał:
>
> [...]
>  - Nonetheless, assumptions that various math operators should be infix 
>is understandable because that's what people see today. 
>

I'd recommend to do some crawling on Racket code base to see what percent 
of used functions are "math operations" -- my guess is that it's going to 
be very small.
While I can see some reasons behind having infix syntax, namely -- 
asymmetric binary prediates -- most of it can be resolved within 
s-expressions (I have described it in SRFI-156 
).

Another place where I think infix could be handy is in functions' type 
signatures in typed/racket.

I believe that, rather than

(: list-length (All (A) (-> (Listof A) Integer)))

it would be better to write something like:

(declare list-length : (All (A) (Listof A) -> Integer))

or

(declare (list-length (Listof ,A)) -> Integer)

But this also could be easily achievable within the realm of s-expressions.

-- 
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/a22f254b-8fc6-437d-9bf2-1b56cd271508%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Racket2 and syntax

2019-07-15 Thread Maciek Godek
I hope you don't mind me adding my two cents to the discussion.
I believe that people who use Lisp tend to see the advantage of its syntax 
for meta-programming.

As Richard Gabriel and Guy Steele wrote in "The Evolution of Lisp",

Algol-style syntax makes programs look less like the data structures used 
to represent them. In a culture where the ability to manipulate 
representations of programs is a central paradigm, a notation that 
distances the appearance of a program from the appearance of its 
representation as data is not likely to be warmly received (and this was, 
and is, one of the principal objections to the inclusion of loop in Common 
Lisp).

On the other hand, precisely because Lisp makes it easy to play with 
program representations, it is always easy for the novice to experiment 
with alternative notations. Therefore we expect future generations of Lisp 
programmers to continue to reinvent Algol-style syntax for Lisp, over and 
over and over again, and we are equally confident that they will continue, 
after an initial period of infatuation, to reject it. (Perhaps this process 
should be regarded as a rite of passage for Lisp hackers.)


Personally, I had a lot of objections when SRFI-105 and SRFI-110 were 
ratified. I thought that it's going to be more harmful than helpful, as it 
would only increase the entropy of the Lisp code base.

I still don't think that syntax is the problem. I think that we should be 
able to switch between different representations of "the same thing", but 
if we want this to be possible, we need to surpass the idea of syntax (or 
the idea that programs need to be text that is parsed).

Maybe the direction similar to where "I think we should be heading" is 
somewhere between Mathematica notebooks and Smalltalk's object environments.

I wrote a bit more about it here (I intended to present that during 
Racketfest in March, but unfortunately I ran out of time)

https://www.quora.com/Can-you-create-a-better-syntax-of-Lisp/answer/Panicz-Godek


-- 
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/2080dcd1-a36b-4cd5-93c7-e692ea877509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Thinking in scheme / racket

2019-07-11 Thread Maciek Godek
Hi Bob!

W dniu czwartek, 11 lipca 2019 03:36:32 UTC+2 użytkownik Bob Heffernan 
napisał:
>
> On 19-07-10 02:46, Maciek Godek wrote: 
> > A while ago, I wrote a booklet which used almost the same problem to 
> > introduce to, what you called nicely in the title of this thread, 
> "thinking 
> > in Scheme", so if you're interested, you may want to check out the first 
> > chapter ("Introduction"): 
>
> Maciek, 
>
> Thank you for your reply. 
>
> I skimmed through your booklet some time ago.  (I too dislike the R 
> language, although some attempts have been made in recent years to make 
> it less awful).  I read through the introduction again this morning and 
> enjoyed it. 
>
> The reason I like racket (and scheme-like languages in general) is that 
> they encourage the style of programming you are advocating (I think) 
> where the program is expressive and can be read and appreciated by 
> humans.  In theory, my favourite style of programming is one that is 
> elegant and readable by humans. 
>
> My original email had to do with the problem of when this comes into 
> conflict with a prosaic computational task where my main aim is simply 
> to get the job done efficiently and my brain defaults to writing the 
> program in something like C. 
>
> For instance, another way of writing something like my original program 
> might be something like: 
>
> (define (f n) (- (expt 2 n) 3)) 
> (define (good? n) (and (positive? n) (prime? n))) 
> (length (filter good? (map f (range 1 100 
>
> which is, I think, fairly expressive.  It is still, however, relatively 
> inefficient.  A python programmer might write something like 
>
> count = 0 
> for n in range(1, 1000): 
> if 2 ** n - 3 >= 0 and isprime(2 ** n - 3): 
>   count += 1 
>
> print(count) 
>
> and happily report that her program ran quite a bit faster than mine. 
>
> I'm not sure how I'd advocate for Racket (or scheme) in a situation like 
> this. 
>
>
I agree that the subject isn't easy.
I used to think that the Haskell code similar to your Racket code 
(or my code from the pamphlet) could be made as efficient 
under lazy evaluation as the imperative Python code you wrote above.
In principle, this should be possible, but as I have measured similar
Haskell code, it turned out to be orders of magnitude more resource hungry
(both time and memory).

I also recall that I once wrote a graph searching program for my professor
at a university. He wrote his version in C, but he had a bug that he 
couldn't
find. My version written in Scheme ran for around 2 weeks (in Chez).
His version ran in under 2 hours (after we fixed the bug).

Yet it's correctness, rather than performance, that should be our priority,
which is why learning to think systematically is important.

I prefer to use Racket over Python because of the versioning hell
that Python has gotten itself into. Racket comes bundled with a fairly
nice framework for developing GUI applications, which works on
Windows, Linux and OS X. Python has an excellent yet little known framework
for GUI apps called Enaml (I really wish Racket had something similar),
but deploying it is a hell.

I also think that functional programming perhaps seems to make little sense
in a small scale, but as your programs grow large, it becomes increasingly 
important.

-- 
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/42c9859f-c355-49f1-a226-e396e2e90c6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Thinking in scheme / racket

2019-07-10 Thread Maciek Godek

W dniu wtorek, 9 lipca 2019 14:09:04 UTC+2 użytkownik Bob Heffernan napisał:
>
> Dear all, 
>
> I recently wanted to count the number of primes in the sequences 2^n+3 
> and 2^n-3 (and a few more besides) where n is a positive integer. 
>
>
Hi!

A while ago, I wrote a booklet which used almost the same problem to 
introduce to, what you called nicely in the title of this thread, "thinking 
in Scheme", so if you're interested, you may want to check out the first 
chapter ("Introduction"):

https://github.com/panicz/pamphlet
 
HTH
Panicz

-- 
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/1240f18d-fcee-4daa-8497-7c66fcd22c0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: 7 GUIs

2019-06-13 Thread Maciek Godek

And one more thing,
someone provided a purely functional solution for the Draggable Rectangle 
Challenge in F# (I think it might be interesting to some).
The links can be found here:
https://www.quora.com/What-does-object-oriented-programming-do-better-than-functional-programming-and-why-is-it-the-most-popular-paradigm-when-everybody-seems-to-say-functional-programming-is-superior/answer/Panicz-Godek/comment/89048060

W dniu czwartek, 13 czerwca 2019 13:40:46 UTC+2 użytkownik Maciek Godek 
napisał:

>
>
> W dniu niedziela, 2 czerwca 2019 01:47:20 UTC+2 użytkownik Matthias 
> Felleisen napisał:
>>
>>
>> Someone recently mentioned the “7 GUIs” task. I spent a couple of days to 
>> write up minimal solutions: 
>>
>>  https://github.com/mfelleisen/7GUI/blob/master/task-7.rkt 
>>
>> In my spare time, I will develop this repo in more depth (types, units, 
>> etc) because it looks like a reasonably educational task. 
>>
>>
> FWIW I also came up with an even more interesting benchmark for GUIs, that 
> I called "The Draggable Rectangle Challenge"
>
> Here's one description
>
>
> https://eidolon-language.quora.com/Draggable-rectangle-challenge-part-I-the-introduction
>
> the solutions (in fairly portable Scheme, Racket-compatible) are described 
> on the blog.
>
> The code (presented by me on Racketfest) is also available in the repo 
> (with the required modules for Racket):
>
> https://github.com/panicz/sracket
>
> (BTW slides for the Racketfest talk can be found here: 
> https://github.com/panicz/writings/tree/master/talks/racketfest)
>
>

-- 
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/02154b24-742a-4082-b7c7-d8f0cf50a67c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: 7 GUIs

2019-06-13 Thread Maciek Godek


W dniu niedziela, 2 czerwca 2019 01:47:20 UTC+2 użytkownik Matthias 
Felleisen napisał:
>
>
> Someone recently mentioned the “7 GUIs” task. I spent a couple of days to 
> write up minimal solutions: 
>
>  https://github.com/mfelleisen/7GUI/blob/master/task-7.rkt 
>
> In my spare time, I will develop this repo in more depth (types, units, 
> etc) because it looks like a reasonably educational task. 
>
>
FWIW I also came up with an even more interesting benchmark for GUIs, that 
I called "The Draggable Rectangle Challenge"

Here's one description

https://eidolon-language.quora.com/Draggable-rectangle-challenge-part-I-the-introduction

the solutions (in fairly portable Scheme, Racket-compatible) are described 
on the blog.

The code (presented by me on Racketfest) is also available in the repo 
(with the required modules for Racket):

https://github.com/panicz/sracket

(BTW slides for the Racketfest talk can be found here: 
https://github.com/panicz/writings/tree/master/talks/racketfest)

-- 
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/e02e37bd-7fec-4fad-b354-359c7b827133%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.