Re: [racket-users] RacketCon, join today! For freedom!

2020-10-19 Thread Konrad Hinsen

Am 16.10.20 um 15:39 schrieb Jay McCarthy:


https://con.racket-lang.org/


RacketCon was a really nice experience, and for me my first contact with 
the Racket community outside of this mailing list. Thanks to Jay who did 
an excellent job as an online conference host!


Cheers,
  Konrad

--
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/4276e55b-4210-c417-978b-7d24c764fab7%40fastmail.net.


Re: [racket-users] Is there an expanded form of the Racket2 purpose declaration?

2019-08-29 Thread Konrad Hinsen
Robby Findler  writes:

> Of course, it is good to make it easy to move to new versions of the
> language, but if there is no real benefit to the transition for the
> programmer (eg they aren't planning to touch that code for the next N
> months anyway as it does its job well) then I think we should let them
> leave it alone and come to it when they need to.

I very much agree with that point of view!

Programmers come in so many varieties these days that it's hard to make
generally valid statements about them. Apple's approach has worked well
for them indeed, but that's in the context of commercial application
development for a dominantly technophile user base. Different contexts
(open source, educational, in-house software, ...) and different user
categories (banks, lawyers, scientists, ...) require different
approaches.

On the other hand, I am not sure that it is possible for a development
environment to stay completely neutral on the issue of mandatory change
and please everyone. But I'd love to be proven wrong about this.

For an in-depth analysis of this question in the specific context of
scientific computing, see

   https://hal.archives-ouvertes.fr/hal-02117588

Konrad.

-- 
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/m1k1aw33pg.fsf%40ordinateur-de-catherine--konrad.home.


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

2019-07-16 Thread Konrad Hinsen
David Storrs  writes:

> The list is named racket-users, so the question of "who do we want as
> Racket users?" seems pretty on-point to me. Still, I get how it might not
> interest everyone. Maybe just mute this thread?

It's not so much this thread as future threads that are likely to
arrive, judging from what has happened in many other places.

The name of the list was chosen aeons ago in different circumstances,
so I don't think it should be the basis for defining the list's purpose
today. The question is rather whether we want to combine or separate
community introspection and community purpose. I am for separating.

Konrad.

-- 
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/m1v9w1rfug.fsf%40ordinateur-de-catherine--konrad.home.
For more options, visit https://groups.google.com/d/optout.


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

2019-07-16 Thread Konrad Hinsen

Sam,

Matthias, I disagree with this. First, we all believe that the Racket 
community is one of the most important parts of Racket. Given that, 
how to make it the community we want it to be, and how to welcome as 
many new people to our community as possible, are fundamental to what 
we discuss on this list.


I can see the utility of a forum to discuss these questions, but does it 
have to be this list?


My experience is that community introspection can easily invade on-line 
discussions to the point of drowning everything else, and driving away 
people who are more interested in the stated goal of the community than 
in its management and policies.


Konrad.

--
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/c6319b95-b166-e29b-9d0d-2f1f2a3bd774%40fastmail.net.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Building "#lang dungeon"

2019-07-15 Thread Konrad Hinsen
Hi Christopherm

> Of course I don't expect someone to launch solitaire from the REPL, and
> indeed there are UX considerations once we move from the REPL to actual

I wasn't thinking so much of UX issues, but of the differences in the
level of abstraction that different people need. The capabilities that
you would pass to a low-level file handling library may well make no
sense to the end user who is barely aware that his solitaire game
uses files to store scores or whatever else.

Android permissions are a good illustration. They are too coarse-grained
for meaningful protection (e.g. access to the whole filesystem or no
files at all), and at the same time too technical for most users who
don't know (nor want to know) how and where data is stored.

Konrad.

-- 
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/m18sszcf3a.fsf%40khs-macbook.home.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Building "#lang dungeon"

2019-07-15 Thread Konrad Hinsen
Hi Chris,

While I understand the general goal you are aiming at, it isn't quite
clear to me who you are trying to protect against who. There's a wide
spectrum of people involved, ranging from language designers via library
developers and application developers to end users. Who is going to
define your capabilities? Who is supposed to be protected by them?  And
who is the potential villain whose evil doings need to be checked for?

Your example doesn't help much with this, as playing a game of solitaire
from the Racket REPL is not a relevant real-life scenario. The typical
solitaire player is an end-user who double-clicks an application and
wouldn't understand the implications of granting access to a single
window. Technical measures to establishing trust work only between
technology experts. So perhaps you aim at protecting application
developers against abusive libraries? In that case, I'd expect the main
challenge to be the design of a sufficiently flexible yet manageable
capability system that doesn't add tons of additional complexity to
software.

Konrad.

-- 
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/m1blxvsp4m.fsf%40ordinateur-de-catherine--konrad.home.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] New Package: Dynamic FFI - Write C Code Inline

2019-06-03 Thread Konrad Hinsen

On 01/06/2019 21:06, David Benoit wrote:
I've recently released a new library 
 for dynamically 
generating FFI bindings to C by parsing header files.
It also allows users to create FFI libraries by writing C functions 
directly inline in Racket programs.


Thanks, this looks very promising! Even more so with the option of 
generating static FFIs that I saw in the documentation. That's important 
in practice to prevent LLVM and clang becoming dependencies for lots of 
Racket code.


Now if you could also provide a tool for dynamically generating free 
time for playing with this, I'd be even happier ;-)



Konrad.

--
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/0bf94bb8-6211-13f0-a86e-4adf027f31ee%40fastmail.net.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] anyone using single-flonums?

2019-05-31 Thread Konrad Hinsen
Matthew Flatt  writes:

> At Thu, 30 May 2019 12:10:37 +0200, Konrad Hinsen wrote:
>>
>> Right now, no, but I have used them briefly in a past project, for 
>> testing the impact of single-precision on a numerical algorithm.
>
> Thanks for replying!
>
> Would using `math/bigfloat` (where you get to pick the precision) have
> worked in that case? In a small example, I imagine you could import
> `math/bigfloat` and strip the `bf` prefix using `filtered-in` to
> replace the usual arithmetic operations with bigfloat variants. But I
> expect that would become painful in a larger example, especially if
> multiple modules are involved.

Right. Yes, math/bigfloat is a good substitute in my situation.  Even a
better one because it permits a detailed exploration of the impact of
varying precision.

My test case was a small algorithm, implemented as four functions in a
single module, so adapting the code would not have been a problem, but
as you say, it risks being a pain for bigger code. Perhaps someone
will do #lang bigfloat one day, that would be the perfect tool for
the kind of work I did back then - but which probably few people
in the Racket community will ever do.

Konrad.

-- 
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/m1sgsvytse.fsf%40ordinateur-de-catherine--konrad.home.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] anyone using single-flonums?

2019-05-30 Thread Konrad Hinsen

Am 29.05.19 um 17:52 schrieb Matthew Flatt:


Does anyone use single-flonums in Racket?


Right now, no, but I have used them briefly in a past project, for 
testing the impact of single-precision on a numerical algorithm.


The main reason to use single-precision floats nowadays is cutting 
memory use in half, both because it is sometimes a scarce resource and 
because a smaller memory footprint means better cache utilisation. 
Single-precision arrays thus matter more than individual numbers. I have 
even seen half-precision floats being used for the same reason. With the 
current interest in "big data" and machine learning, I expect this 
tendency to increase.


Konrad.

--
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/18ea72d3-cfdf-03e2-06a2-ef5e136ff834%40fastmail.net.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Help with generators from python land!

2019-02-25 Thread Konrad Hinsen

On 23/02/2019 14:25, Zelphir Kaltstahl wrote:

The main difference, as has been pointed out before, is that Python
generators are more common as an idiom for solving problems that in
Racket would typically be approached differently.

This piqued my interest. Can you elaborate a bit or give an example? How
would one approach things with Racket differently?


Stream and sequence processing in Racket cover much of what generators 
are used for in Python. The simplest example is stream-map in Racket, 
whose Python 2 equivalent would require a generator. In Python 3, the 
standard map has become lazy.


Konrad.


--
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] Help with generators from python land!

2019-02-21 Thread Konrad Hinsen

On 21/02/2019 20:40, Zelphir Kaltstahl wrote:
Python, I believe, has some kind of `Iterable` interface, which a 
generator satisfies and which specifies the method to call to get the 
next value. In Racket maybe one would have to do with a convention of 
how to get a next value from a lazy list.


Python's concept of iterables is very similar to Racket's streams 
(https://docs.racket-lang.org/reference/streams.html) and sequences 
(https://docs.racket-lang.org/reference/sequences.html). And Python 
generators are very similar to Racket generators 
(https://docs.racket-lang.org/reference/Generators.html). The main 
difference, as has been pointed out before, is that Python generators 
are more common as an idiom for solving problems that in Racket would 
typically be approached differently.


Konrad.


--
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] Real-world examples of XML usage?

2019-02-05 Thread Konrad Hinsen
David Storrs  writes:

> to type things.  In addition, most developers that I've worked /
> talked with will typically reach for the JSON API before the XML one
> given the choice.  I think the ground truth suggests that JSON is a

Ah, I see, we are working in very different contexts. In a Web API, I'd
go for JSON as well. After all, you need little more than a
serialization format for the input and output parameters of the API functions.

But my main use case is data storage in self-contained files stored in
databases (including Git repositories), to be read by existing or
yet-to-be-written software. The data can be quite complex, so any
machine-readable description of its structures is a plus. XML on its own
already provides the tag structure, and a schema adds much more
documentation, still in a standard format.

Konrad.

-- 
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] Real-world examples of XML usage?

2019-02-04 Thread Konrad Hinsen
David Storrs  writes:

>> This:
>>
>>https://mosaic-data-model.github.io/
>
> That looks very cool, and like something that I'd like to talk to you
> about professionally.  Would you mind if I contact you off-list?

Not at all!

> Wow.  That's impressive, and seems like something that could have a
> real impact.  Kudos.

We'll see. The whole idea is still very hard to "sell".

>> In both cases, the motivation was to facilitate access to the data for
>> as many software developers as possible. There are good XML support
>> libraries for most programming languages, even Fortran.
>
> True, but most languages also have good JSON tools, YAML tools, etc.

Yes, those are the obvious competitors. But YAML is probably worse than
XML in terms of overengineering (see
e.g. 
https://medium.com/@lefloh/lessons-learned-about-yaml-and-norway-13ba26df680)

> "Overengineered" is a good way to put it -- I think that's what
> bothers me about XML.  I do grant its utility, I'm simply not
> convinced that most of it is necessary for most cases.

Me neither!

> I was specifically thinking of JSON.  It allows for encoding all the
> essential structure of XML in far fewer characters, meaning there's
> less data to send over the wire. It's more human-readable. There are

JSON is basically a serialization notation for nested lists and hash
maps. What it lacks compared to XML is tags and namespaces. You have to
add a layer of conventions on top of JSON to get some form of data
identification, and since that layer is not standardized, it's likely to
get messy once you need to work with data from different sources.

JSON is probably a good choice if all software working with your data is
under your control. Less so if the client software pool is open-ended or
if the data may be archived for an indefinite future with different
software tools.

Konrad.

-- 
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] Re: performance: Racket vs Julia

2019-02-03 Thread Konrad Hinsen
Matthias Felleisen  writes:

> It is rare that I have to somewhat-contradict Matthew here, but so it goes. 
>
> One of my colleagues, Jan Vitek, has studied Julia with a special
> focus on performance. As many have said, Julia is good at numerics
> because its compiler can specialize certain cases really well. More

I'd really like to see something like Julia as a special-purpose
language in a general-purpose language ecosystem such as Racket.

Having to choose between numerical performance and good support for
non-numerical stuff such as user interfaces is a real pain. Given that
performance almost always trumps everything else in number crunching,
the result is that number crunching software is always bad from every
point of view other than performance.

Konrad.

-- 
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] Real-world examples of XML usage?

2019-02-03 Thread Konrad Hinsen
David Storrs  writes:

> What projects have y'all done where XML was the best choice for a
> reason other than "because we needed to interoperate with a service
> that required XML"?

This:

   https://mosaic-data-model.github.io/

and this:

   https://github.com/khinsen/leibniz/

In both cases, the motivation was to facilitate access to the data for
as many software developers as possible. There are good XML support
libraries for most programming languages, even Fortran.

The other candidates in such circumstances are JSON and YAML, but you
get a lot more structure for free with XML than with JSON, while
avoiding the enormous complexity of YAML. I also found some utility in
schemas and schema-based validation tools, although that universe looks
heavily overengineered to me. Still, it's work done by others that I
don't have to repeat myself.

I think someone suggested s-expressions here. That would be a fine
option, if there were better support for it in non-Lisp languages.

> On the other hand, XML is extremely heavyweight, thereby slowing
> parsing and transmission as well as making the data less
> human-readable.

Compared to what? Special-purpose data format? Design your own language,
write you own parsers, working at the character level? I don't write
software in assembly for good reasons, and for the same reasons I want
higher-level data formats than just character streams.

Konrad.

-- 
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] sxml vs xexpr frustrations

2019-01-30 Thread Konrad Hinsen

Am 30.01.19 um 19:27 schrieb Christopher Lemmer Webber:


One very frustrating thing for me is the inconsistency between which
sexp xml representation is the "right" one, sxml or xexpr.  Different
tools support different things, and thus don't interoperate when they
easily could have.


Sounds... familiar.


IMO, it makes more sense to have sxml be the "right" one, since it has
wider user outside of just Racket, and there are some much nicer tools
available for it:


On the xexpr side, there are some very nice tools as well, in particular 
Matthew Butterick's Pollen:


https://docs.racket-lang.org/pollen/

and its low-level foundation txexpr:

https://docs.racket-lang.org/txexpr/index.html

I actually migrated code from SXML to xexpr in order to be able to use 
Pollen.


Konrad.

--
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] Using Racket's raco on on Guix(SD)

2018-05-24 Thread Konrad Hinsen

On 22/05/2018 15:42, Christopher Lemmer Webber wrote:


Unfortunately when I try to install packages with "raco pkg install"
I get errors like the following:


I filed a bug report about this problem a while ago:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30680

Quote:

  I traced this back as far as I could by looking at the Racket compiler
  source code. Compilation generates a temporary file in the same
  directory where the result is supposed to go. If no errors occur, the
  temporary file is then renamed to become the output. The partial stack
  traces point to locations in the code that do a recursive traversal of
  a library in order to compile everything. Unfortunately, the part that
  decides where the output goes is not referenced in the stack trace.


I seem to remember a couple of packages failing altogether, though in
the present moment I think the result is bad performance due to not
being properly compiled, but I'm not really sure.


In my tests, all packages ended up working, but performance is indeed 
worse than with a Racket installation outside of Guix.


It would be nice if someone with more knowledge of Racket internals 
could give a hint or two for debugging this issue!


Konrad.

--
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] Racket on the cover page

2018-03-01 Thread Konrad Hinsen

On 26/02/2018 17:42, Matthias Felleisen wrote:


   https://cacm.acm.org

Hi everyone, Racket made the cover page of the Communications of the ACM, the 
ACM’s flagship magazine. We are trying to bring across the idea that research 
on language-oriented programming is needed and that Racket has a leg up here. 
Most of you understand the idea but here it is in magazine and video format, 
and we really need to spread the message — Matthias



Actually, I just stumbled on a video that provides some very good 
arguments for language-oriented programming:


   https://www.youtube.com/watch?v=Oiw23yfqQy8

It's Guido van Rossum's retrospective on the transition from Python 2 to 
the partially incompatible Python 3. In a multi-language programming 
environment, 90% of the issues discussed there simply do not exist, 
because different languages are allowed to co-exist. And perhaps even 
more importantly, most language features shown off as reasons to adopt 
Python 3 (at 23:14 in the video) would just be small libraries in the 
Racket universe.


Something else that I realized while watching this video is that making 
object-orientation a fundamental language feature is not a good idea if 
you want to leave room for future changes. Python 3 introduced some 
changes to object semantics, which makes it hard to have Python 2 and 3 
coexist in a single runtime because it isn't clear what happens when 
Python 3 code calls a method from Python 2 code or vice versa.


Konrad.

--
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] Racket on the cover page

2018-02-26 Thread Konrad Hinsen

On 26/02/2018 17:42, Matthias Felleisen wrote:


   https://cacm.acm.org

Hi everyone, Racket made the cover page of the Communications of the ACM, the 
ACM’s flagship magazine.


Congratulations!

I find the article quite convincing, but then I was already 
pre-convinced. Would be interesting to see reactions from people who 
didn't know about Racket before.


Konrad.

--
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] Adding interactive overlays to racket plots

2018-01-30 Thread Konrad Hinsen

On 29/01/2018 12:09, Alex Harsanyi wrote:

I have built a prototype implementation of adding interactive overlays 
to plot snips, as shown in the image below, and I would like to ask if 
there is interest in adding such a feature to the plot package 
distributed with racket.


Yes, definitely!

Konrad.

--
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] Using ffi/unsafe/alloc

2018-01-25 Thread Konrad Hinsen
Hi Dmitry and Matthew,

Thanks for your suggestions, which, although quite different, turned out
to be both useful for me. As you can imagine, my real C API is a lot
more complicated. There are dependencies between allocated memory
blocks, i.e. freeing one can invalidate another one. More fine-grained
control is very welcome there, and now I know where to look for it.

Thanks,
  Konrad.

-- 
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] Using ffi/unsafe/alloc

2018-01-24 Thread Konrad Hinsen

Hi everyone,

I am working on an FFI which overall progresses well - the Racket FFI 
library is really a very nice tool to have.


The one problem I couldn't solve yet is handling resource allocation. My 
use case is very similar to what allocator/deallocator are meant for, 
except that the allocated object is not the return value of any 
function, and therefore I cannot use allocator.


I have an API like

   int make_foo(foo** new_foo);
   int destroy_foo(foo* a_foo);

so my FFI definitions look like

  (define _foo (_cpointer 'foo))

  (define-fooapi make-foo
 (_fun (foo : (_ptr o _foo)
-> (r : _int)
-> (values r foo))

  (define-fooapi destroy-foo
 (_fun _foo -> _void))

Given that make-foo returns two values, I cannot use #:wrap to make it 
an allocator.


Since the C API I am wrapping is pretty standard, I suspect others have 
had this problem before. Any suggestions?


Thanks in advance,
  Konrad.

--
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] Alternatives to DrRacket

2017-11-26 Thread Konrad Hinsen

On 26/11/2017 16:42, Stephen De Gabrielle wrote:

I know two big reasons for using a complex tool is it’s stickiness 
factors; normally a combination of familiarity (hence speed) with a lot 
of powerful features and non-transportable customisation.


A third big reason is generality. The main reason why I prefer Emacs to 
DrRacket is that it does so many things unrelated to Racket. Anything 
that requires a text-based interface can be done in Emacs.


Putting stickiness factors aside, what features in other editors/IDE’s 
would you like to see in DrRacket?


Since I do use DrRacket from time to time for very Racket-specific 
things (e.g. the debugger and the macro stepper), I do have a small 
wishlist:


1) Paredit mode like in Emacs, sufficiently compatible that I can switch 
seamlessly between the two.


Well, that's it. Just one point.

Konrad.

--
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] where does DrRacket get its environment variables on OS X?

2017-11-09 Thread Konrad Hinsen

On 08/11/2017 17:48, 'John Clements' via Racket Users wrote:


IIRC, Mac has an apologetic moue towards unix-y things here: I believe there’s 
a special place in your home directory … or maybe it’s in 
~/Library/Preferences, which would …

okay, let me search.

Okay, here you go:

https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x#588442


That link points to the two good solutions (the one the link points to, 
and the one just after it) for setting global environment variables with 
recent versions of macOS. The second one (lauchctl setenv ...) is often 
the better one, in particular because it can be used on a per-user basis.


It's worth pointing out that macOS has changed its handling of 
environment variables a few times in the past, so you can easily find 
suggestions and recipes that no longer work, or (almost worse) no longer 
work reliably. The best known one of these is modifying 
$HOME/.MacOS/environment.plist, which was the preferred approach in some 
distant past.


If you want the same environment variables in a shell running in a 
terminal and in GUI-based applications, you have to take care in 
configuring both environments in the same way. The obvious approach 
might seem to be not to set environments in the shells at all, letting 
them inherit the global environment, but given that the terminal app 
runs shells as login shells, this doesn't work.


Konrad.

--
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] code reflection

2017-10-21 Thread Konrad Hinsen
Matthias,

> Yes, on rare occasions, Racket programmers need to use the FFI 
> to link in C libraries, C developers need to include ASM, and 
> so on. But when we can, we should really stick to high-level 
> linguistic constructs when possible and available, especially 
> when they provide a safer way of doing things. 

At that level of abstraction in the discussion, I certainly agree.

However, macros are different because I consider syntax-parse a DSL, not
a general purpose language like Racket, C, or ASM.

I checked my code to see what the unpleasant macros in there are doing.
It's not the standard syntax transformation stuff, which syntax-parse
does very well. I need to transform syntax in place but ALSO extract
information from macros and collect them for re-using it elsewhere.
It's not very different from what #lang scribble/lp2 does when it
puts code blocks both in the module and in the documentation.

In my experience, syntax-parse is not very good for shuffling stuff
around like this. It's very probably not what it was designed for
either.

Konrad.

-- 
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] code reflection

2017-10-19 Thread Konrad Hinsen
Matthew,

> If your goal is readable code, why not add some sugar?

That's a perfectly good solution.

> More broadly, it feels like there's plenty of room for new
> macro-definition and syntax-processing forms that suit different
> ergonomic needs: readability, automatic error messages, debugging, and
> so on.

That's pretty much what I had in mind.

> Interesting question why more of them don't exist. For `#lang
> br` I made a set that were designed for simplicity and
> readability. [1]

These looks interesting, thanks! I'll have a closer look later.
I guess that some people would object to making all-upper-case a
semantic marker, but in terms of readability this looks nice.

Konrad.

-- 
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] code reflection

2017-10-19 Thread Konrad Hinsen
Matthias,

> Please search my post for ‘hygiene’. I didn’t mention the word. Off — Matthias

Oops, you are right, sorry. Your example used "let", which is also what
everybody used for discussing hygiene, so I jumped to conclusions.

Your argument is that pattern matching works at a higher level of
abstraction than decomposing s-expressions, and that type-like
annotations add useful error checking to those patterns. Point taken.
And I certainly agree.

But higher-level abstractions are always specializations. For many macro
situations, pattern matching is the right abstraction. For others it
isn't, and then syntax-parse can become a pain. I have experienced this
quite a few times.

So let me reformulate my original suggestion: it would be nice if
syntax-parse would let me step down one level of abstraction when
that seems the better choice.

Konrad.

-- 
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] code reflection

2017-10-18 Thread Konrad Hinsen
Matthias,

> It’s quite doable but I think this misses the point

I see that I haven't made my point clearly enough (if at all). I
certainly don't want to go back to unhygienic macros without error
checking.

What I do want to go back to is doing simple manipulations of syntax
objects using familiar list functions. A simple example I encountered
recently is probably the best illustration.

Somewhere in a syntax class, I had a syntax object which was checked to
be a list with at least three elements. I needed to remove the first
element and add it in front of the others. On a plain list, I could do
this half asleep. But with the list wrapped in a syntax object, even
after considerable thought I am not sure what the best approach would
be.

Unwrap (syntax->datum), apply list functions, rewrap? The resulting code
is not very readable, the wrapping stuff being much more visible than
the code that does the real work. Pattern match against (a b c ...)? OK
for this particular case, but not for the next case I knew I would
have to deal with. Read through the extensive documentation of
syntax-parse, hoping to find the perfect solution?  Not a very exciting
prospect.

Note that hygiene is not an issue here. In 80% of my macro code, hygiene
is not an issue, nor is error checking. For the other 20%, syntax-parse
is just fine.

> I think what we’re really seeing here is that backwards compatibility
> sometimes smothers elegant solutions.  I firmly believe that in this
> case we should simply throw out syntax-rules and syntax-case

A very good idea. At least throw it out from the tutorials and all
example code. Point people to syntax-parse right from the start.  Keep
syntax-case to avoid breaking code, but don't advertise it any more.

> Other Matthew has written a book from a particular angle. It’s
> beautiful but clearly leaves an unsatisfied need behind. 

I'd say the unsatisfied need is in between the tutorial for beginners
and the reference documentation. Something that helps finding a good
solution for a specific problem, for someone who knows the basics of
syntax-parse. It could be a curated collection of case studies.

Konrad.

-- 
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] Racketeers and slide-show presentations

2017-09-17 Thread Konrad Hinsen

On 16/09/2017 16:47, Daniel Brunner wrote:


I switched to slideshow/pict recently but it takes a lot of time for me
to prepare the presentation due to my missing skills in using pict.


That's also the major stumbling block for me. Whenever I have to prepare 
a presentation, it's just not the right moment to invest time into 
learning pict.


Did anyone consider to implement something like sketch-n-sketch for 
Racket picts?


  https://ravichugh.github.io/sketch-n-sketch/

The idea is to combine interactive manipulation and programmatic 
construction in an intelligent way. This could help a lot for 
simplifying the kind of picts that are difficult to do purely 
programmatically.


Konrad.

--
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] Racketeers and slide-show presentations

2017-09-17 Thread Konrad Hinsen

On 16/09/2017 21:48, Andrew Gwozdziewycz wrote:


I've been hacking on a way to make *simpler* slideshow presentations, which 
I'll actually present briefly at Racketcon next month. The idea is to take 
something plaintext and turn it into slides, so you don't have to be a pict 
master. I am trying to work in how to include slides that are Picts, but it's 
still a bit early.


This looks interesting! But it also looks like you are inventing yet 
another lightweight markup language. You do mention Markdown as an 
inspiration, so why not use it fully? There's a Markdown parser ready 
for reuse:


   https://docs.racket-lang.org/markdown/

For slideshow-specific features such as speaker notes, you could copy 
other Markdown-based slideshow tools, e.g. reveal.js.


Konrad.

--
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] Unit tests for a #lang implementation

2017-09-01 Thread Konrad Hinsen
Matthew,

> If you'd like the test namespace and the test-driving module to share
> the instance of the module that defines `document` (so that they'll
> agree on the data structure), you can use `namespace-attach-module` to
> attach the test-driving module's instance to a newly created namespace.

Thanks again for a valuable pointer to the Racket documentation!

This works well for modules that my test module requires directly,
as in your example. I haven't been able to get any useful results
for modules that are required indirectly (i.e. your module "a.rkt"
requiring "c.rkt" and re-providing a struct from there). Depending
on which combination of modules I run namespace-attach-module on,
I either get my initial error or another one:

amespace-attach-module: a different module with the same name is already in the 
destination namespace
;   module name: "/Applications/Racket v6.10/collects/racket/pretty.rkt"

None of my code refers to pretty.rkt.

I think I will simply give up at this point. Compared to depending on
complex stuff that I don't understand, nor want to understand, a
separate testing shell script seems like the lesser evil.

Thanks again,
  Konrad.

-- 
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] Unit tests for a #lang implementation

2017-08-31 Thread Konrad Hinsen

On 25/08/2017 17:03, Konrad Hinsen wrote:

That adds the missing piece - thanks a lot! I had seriously 
underestimated the complexity of module definitions in Racket.


A followup mostly for the benefit of those who find this thread in the 
archives one day.


Importing a module this way works perfectly, but its utility for testing 
is very limited. The problem I run into is illustrated by the following 
symptom:


raco test: (submod "lang-test.rkt" test)
document-contexts: contract violation;
 given value instantiates a different structure type with the same name
  expected: document?
  given: (document (hash "test-context"  ...


My code defines a structure called "document", which apparently exists 
in two copies in memory. One is used by the module lang-test.rkt that 
contains the tests, and the other one is used by the module that was 
created from the text string. As a consequence, it is impossible to 
perform any operation on the date from that module.


If all you recover from that module is basic Racket data structures, 
everything works fine.


Konrad.

--
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] Generate function defintions at compile time

2017-08-28 Thread Konrad Hinsen

Matthias,


If you would like to see a concrete example, fully worked out, see the ICFP 
paper on constructing a domain-specific language for scripting the production 
of videos (say RacketCon presentations):

  https://www2.ccs.neu.edu/racket/pubs/#icfp17-dnff

At the surface, this could be done as a piece of two modules: the surface 
language (boring) and the run-time library that connects to existing NLVE 
systems. But as it turns out, if you truly take the slogan seriously, you can 
easily see how we build this application as a composition of EIGHT (8) DSLs, 
three used at the surface (Video, Typed Video, and Docu Video) and five below, 
inside the application.


This is really a nice illustration of "The Racket Way". Please consider 
pointing to this on the Racket Web site. Or, better yet, put a less 
academic writeup on this example to the Web site.


I found the implementation of the Video language on pkg.racket-lang.org, 
but neither Typed Video nor Docu Video seem to be there. Are they 
available elsewhere? I am particularly interested in Docu Video because 
I wonder if it can be implemented as a composition of "Video" and 
"Scribble" or if it needs to be defined from scratch, re-using only the 
implementation modules of "Video" and "Scribble".


Konrad.

--
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] Unit tests for a #lang implementation

2017-08-25 Thread Konrad Hinsen

On 25/08/2017 16:30, Matthew Flatt wrote:

At Fri, 25 Aug 2017 16:04:01 +0200, Konrad Hinsen wrote:

Putting those together, and using `current-namespace` so that both
`eval-syntax` and check-module-form` use the same namespace:


Thanks, that works!

At least to the point of not getting any error message. I can't say if a
module is actually defined.


I should have suggested setting `current-module-declare-name` during
evaluation of the module form, so that you get to pick the name:



That adds the missing piece - thanks a lot! I had seriously 
underestimated the complexity of module definitions in Racket.


Konrad.

--
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] Unit tests for a #lang implementation

2017-08-25 Thread Konrad Hinsen

Matthias,


Matthew’s response is probably all you want in principle,
but I think that your ‘unit test’ looks like another person’s
‘integration tests’. Both are useful.

Wouldn’t you want to use unit tests to validate the parser
independently of the macros that expand the S-expression
syntax you create with the parser? If you then discover a
failure, it becomes much easier to search for the bug in
either of the two pieces. (I understand that there are many
more pieces but let’s say ‘two’ for now.)


Thanks for your reply!

I guess what I want to do is somewhere in between unit and integration 
tests. I don't really care much about the labels.


I do have unit tests for the low-level implementation details of my 
#lang. They are plain Racket functions with straightforward tests.


What I want to write additional tests for is

 1) The macros that expand the S-expression for my module

 2) Some of the functions used in the expansion, for which
suitable input is difficult to generate without those
macros.

The parser is not my problem - it's borrowed from Scribble and 
presumable tested by someone else :-)


Konrad.

--
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] Unit tests for a #lang implementation

2017-08-25 Thread Konrad Hinsen

Matthew,


Putting those together, and using `current-namespace` so that both
`eval-syntax` and check-module-form` use the same namespace:


Thanks, that works!

At least to the point of not getting any error message. I can't say if a 
module is actually defined. A plain


  (require 'anonymous-module)

fails ("unknown module"). I tried changing the name by manipulating the 
s-expression returned by read-syntax, but I am never able to instantiate
the module that was presumably defined by eval under that name. Is this 
perhaps one of those 
"your-identifier-is-not-from-the-scope-you-think-it-is" problems?


Konrad.

--
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] Unit tests for a #lang implementation

2017-08-25 Thread Konrad Hinsen

Hi all,

I have been trying for a while to write proper unit tests for a language 
implementation I am working on. By "proper" tests I mean tests that are
run using raco test just like any other tests. Until now, I have a 
separate shell-script based testing framework that runs scripts written

in my own #lang, but all too often I forgot to run those tests.

For a standard s-exp based language, this is not difficult:

(module+ test

  (module demo lazy
(provide foo)
(define (foo x) (* 2 x)))

  (require (only-in 'demo foo))

  (check-equal? (force (foo 2)) 4))

But for a #lang that uses a different reader, I haven't found a working 
solution yet. Even if I am willing to re-write my examples in s-exp 
syntax, I run into problems:


(module+ test

  (module example scribble/base
(section "Introduction"))

  (require (only-in 'example doc))

  (check-equal? (force (foo 2)) 4))

This yields the error message

  module: no #%module-begin binding in the module's language

Anyway, what I really want is use the #lang's standard syntax. Reading 
it isn't much of a problem:


(parameterize ([read-accept-lang #t]
[read-accept-reader #t])
   (read-syntax "test-module"
(open-input-string "#lang 
scribble/base\n@section[Introduction]")))


But then I get a syntax-object for my module, which I need to evaluate 
somehow. I'd expect eval-syntax to do the job, but...


(eval-syntax
 (parameterize ([read-accept-lang #t]
[read-accept-reader #t])
   (read-syntax "test-module"
(open-input-string "#lang 
scribble/base\n@section[Introduction]")))

 (module->namespace 'racket/base))

only says

; test-module::1: module: unbound identifier;
;  also, no #%app syntax transformer is bound
;   at: module

although both module and %app are defined in racket/base.

Any ideas (or pointers to examples) for doing this correctly?

Thanks in advance,
  Konrad.

--
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] European Racketeers and conferences

2017-08-23 Thread Konrad Hinsen

On 22/08/2017 20:00, Alexander Shopov wrote:


Hmm, what about the Netherlands? Anyone willing to meet?
@Daniel Brunner: Are you in Wetzlar?
Anyone else around hereabouts?


I am in Paris.

Konrad.

--
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] Re: Racket (or Scheme) macros for C

2017-07-06 Thread Konrad Hinsen

On 06/07/17 23:40, George Neuner wrote:


If you don't need full featured Scheme, but are interested mainly in
efficient object code, you might look at PreScheme.  PreScheme is
statically typed, compiles to C, has very minimal runtime and no GC
(you can deallocate memory manually if desired).


It would be very nice to have something like that as #lang PreRacket!

Konrad.

--
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] Scientific libraries?

2017-06-01 Thread Konrad Hinsen

On 02/06/17 02:50, Alasdair McAndrew wrote:


I have been experimenting with the bigfloat library, which I understand to be a 
wrapper for the GNU MPFR library.  And it works well.  But I'm wondering if 
anybody's given thought about porting other scientific libraries, such as GNU 
GSL to Racket.  Is this the sort of thing which would be very difficult indeed 
- or are there tools available to do the heavy lifting, so to speak, as well as 
much of the coding drudgery?  I would certainly like to have access to GSL.


Racket's foreign-function interface is pretty good:

  http://docs.racket-lang.org/foreign/

Moreover, compared to other languages (Python etc.), you have macros to 
abstract away much of the boilerplate that wrappers inevitably require.


The main work is (1) designing a good API on the Racket side and (2) 
providing sufficient tests that users will trust the code. For GSL the 
API should not be too hard because its structure is simple and it 
doesn't rely on complex data structures.


- Konrad.

--
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] Announcing Leibniz, a new language in the Racket universe

2017-04-27 Thread Konrad Hinsen
Hi Dmitry,

> You may remember me from this topic:
> https://groups.google.com/forum/#!topic/racket-users/E6utg2Pv5hA where
> I looked for a scientific language and a tool for code generation.

Yes, I remember!

> Leibniz seems to be very general. Is generation of (C or other) code
> from Leibniz one of the goals of the project?

Not directly, but indirectly, yes.

Leibniz is a notation, not a computational tool. The immediate goal of
the Leibniz project, in terms of computation, ends at the generation of
machine-readable XML representations of Leibniz data.

This will of course be useful to scientists only if there are tools that
actually read this data and do something useful with it. Code generation
tools would be particularly nice to have. Unfortunately it's also one of
most difficult tasks (if you care about efficiency), and I am not
particularly competent in this (I am a physicist). So I hope someone
else will take up this challenge.

My own plans for Leibniz-aware tools are more modest: I want to use
equations and algorithms written in Leibniz in unit tests for
computational software that implements the same algorithms. The
human-readable Leibniz documents are then verifiable documentation
for hand-written optimized software.

> Regarding the plans of future development of Leibniz, my humble
> opinion is that the "express algorithms" part is very important for,
> um, production use. Also, vectors and matrices.

Vectors and matrices are high up on my to-do list. You can implement
them right now as Lisp-style lists made of cons operators, but I don't
expect computational scientists to be enthusiastic about such low-level
approaches.

> As an example, I would love to see (or be able to write) an equation
> for gravitational N-body problem (with arbitrary N) in Leibniz.

I had this as an example in an earlier prototype:

  
https://github.com/khinsen/leibniz/blob/fb4868519709794ad59e64cab547621c4b5a9a02/examples/mechanics/solar-system.rkt

Since then, nothing but syntax has changed in Leibniz, so this still
gives a good idea of how to proceed. Note that it does construct the
list of bodies with cons operators, and implements pair-wise addition
via recursion, so it's not yet at the level I hope to reach.

- Konrad.

-- 
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] Announcing Leibniz, a new language in the Racket universe

2017-04-26 Thread Konrad Hinsen
Alexander McLin  writes:

> One paper I have in mind is Hodgkin & Huxley's paper published in 1952
> where they first wrote down the equations describing the membrane
> voltage of the giant squid
> axon. 
> https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1392413/pdf/jphysiol01442-0106.pdf
>
> It'll be a good exercise for me to go through it and write a summary,
> transcribing the equations into the Leibniz notation.

After a quick look at the paper, I'd say this should be doable with
the current version of Leibniz, at least for the majority of equations.
One pitfall is the use of pseudo-equations, such as

 P = const. * ...

which looks like an equation but is really an affirmation of
proportionality.

- Konrad.

-- 
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] Plot array

2017-04-22 Thread Konrad Hinsen

On 22/04/17 19:43, Raoul Schorer wrote:


Is there an easy way to plot a 2d or 3d arrays in racket? I am working on some 
array programming problem, and it would be nice to visualize the solution.


Both 2D and 3D plots are part of the excellent plot library:

  http://docs.racket-lang.org/plot/index.html?q=plot

Konrad.

--
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] Announcing Leibniz, a new language in the Racket universe

2017-04-18 Thread Konrad Hinsen
Alexander McLin  writes:

> This looks quite promising, I'm liking the progress and examples so
> far.

Thanks for your feedback!

> I have personal interests in computational science and executable
> biological models, rewriting some classical papers' models into the
> Leibniz notation would definitely be a good aid for study and
> understanding.

Indeed. What would be such classical papers from your field?

> One thing I'm wondering about; for a long time I've been curious about
> the idea of using proof assistants to help explore logical
> consequences of different equation choices in some modeling problem,

I have vaguely played with that idea myself, but I don't know the
capabilities of today's proof assistants well enough to judge how they
could be used in the evaluation of scientific models. Do you have
a concrete application in mind? Something that could be done today
if the learning-curve issue could be overcome?

> I'm not sure how practical that would be, it's too early in my
> understanding of Leibniz's benefits, there's still more to read,
> including Maude documentation.

BTW, semantically Leibniz is a subset of Maude, so automatic translation
into Maude should be straightforward. If there are tools from the Maude
universe that you would like to use, that could be worth trying.

- Konrad.

-- 
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] Announcing Leibniz, a new language in the Racket universe

2017-04-14 Thread Konrad Hinsen
Shriram Krishnamurthi  writes:

> I would suggest adding a @(table-of-contents) to the top of every page: it
> helps the reader know what is coming ahead. For instance, it's good for me

That looks useful indeed. I'll put it on my to-do list for revising
the presentation, stylesheets, etc. For now I am just using
scribble/base.

> Your (lack of) op precedence I find a little confusing, a bit curiously
> given that I'm designing a language with the same op precedence. In Pyret
> we have no op precedence, but we allow a sequence of the same binop to not
> need parens; everything else needs to be parenthesized. We've used this for
> years now with students and it has been received well because it's simple
> and consistent.

That's a very nice suggestion! I wasn't particularly happy either with
my rules, which I took over from APL. But in APL, many operators are
asymmetric in their left and right arguments, so it makes more sense
there.

My very first implementation used the parentheses-everyhere rule, which
became awkward in exactly the situations you describe: ((a + b) + c) + d
etc.

I tried the Pyret conventions and it has improved all my Leibniz
examples, so it's now officially adopted.

BTW, I don't see this mentioned anywhere in the Pyret documentation
(which I wanted to link to in my manual). In fact, the only explicit
discussion I found is this one:

http://papl.cs.brown.edu/2016/p4rs.html#%28part._.Infix_.Expressions%29

- Konrad.

-- 
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] Announcing Leibniz, a new language in the Racket universe

2017-04-13 Thread Konrad Hinsen
Shriram Krishnamurthi  writes:

> The Lotka-Volterra example is very helpful, thanks. It is still a bit
> unclear from the formatting which part is the Leibniz code. Is it the two
> lines marked pp1 and pp2? Are they literal code? I guess I prefer to use a
> typewriter face to make verbatim code clear, though that may be at odds
> with the script-D.

My current typesetting conventions use a light blue background for code.
The main reason is that this convention can be extended to other uses,
such as (in my current version) a green background for computed results.

> Of more consequence, it would be helpful to know what “happens”. I can
> *write* this in Leibniz; that's good. Can I do anything more/else? Maybe
> now, or at least perhaps in the future? Can I do a numeric simulation? Will
> there be a Runge-Kutta solver? What about discretization issues? Etc. Put
> differently, why write it in Leibniz instead of writing it as just a
> regular Racket `reactor` program?

These are all very good questions, which I hope to have answered in my
updated example:

  http://khinsen.net/leibniz-examples/examples/leibniz-by-example.html

> Btw, I'm not entirely sure what the notation ℝp means.

Positive real numbers - that's now explained as well. I have been
looking at this stuff for too long to notice such oversights.

Thanks again for your very useful feedback!

- Konrad.

-- 
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] Announcing Leibniz, a new language in the Racket universe

2017-04-12 Thread Konrad Hinsen
John Clements  writes:

> I really enjoyed poking around in this a bit. One thing that I would
> really have appreciated, if it’s at all possible, would be a small
> motivating example; preferably in the readme of that repo. Is that a
> sensible request?

Shriram Krishnamurthi  writes:

> Do you want to be able to model predator-prey? Or epidemic growth?


This is now in my example collection, and referenced in the README
with a motivation for using Leibniz.

Thanks for your suggestions!

- Konrad.

-- 
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] Announcing Leibniz, a new language in the Racket universe

2017-04-11 Thread Konrad Hinsen

On 10/04/17 17:02, Shriram Krishnamurthi wrote:


Let me ask a few questions that may nudge you a bit:

What is an example of a system you want to model?

For instance:

Do you want to be able to model simple linear motion? Uniform acceleration?

Do you want to be able to model predator-prey? Or epidemic growth?

Are these even in the realm of things you want to model and if not, why not?


Yes, they are.

The last two are indeed good candidates for introductory examples - 
thanks for the suggestion! I suspect they are not small enough to be 
included in the README though, unless I stop at writing down the 
equations, which is probably not very interesting.


The first two are very simple indeed, but probably not a good motivation 
for using Leibniz, given that the equations and typical code in a 
typical programming language look very close already.


The kind of models that I had in mind when starting my work on Leibniz 
are much bigger. Protein models in particular (my main research tool), 
which combine mathematical equations, graph traversal algorithms, and 
thousands of numerical parameters.


- Konrad.

--
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] Announcing Leibniz, a new language in the Racket universe

2017-04-10 Thread Konrad Hinsen

On 10/04/17 01:21, 'John Clements' via Racket Users wrote:


I really enjoyed poking around in this a bit. One thing that I would really 
have appreciated, if it’s at all possible, would be a small motivating example; 
preferably in the readme of that repo. Is that a sensible request?


It's definitely a sensible request! Unfortunately I didn't yet succeed 
to come up with a small motivating example, but that question has been 
on my radar for a while.


The problem that Leibniz aims to solve is the management of complexity 
in computational science. Illustrating complexity in a small example is, 
unfortunately, rather difficult.


As with software in general, there are two aspects to managing 
complexity in computational science:


1) Incidental complexity, which makes software source code complex even 
when the science itself is simple. I have some hope to come up with a 
simple motivating example in this category.


2) Essential complexity, i.e. complex scientific models that can only be 
worked on with the help of computers. Finding a small example for that 
situation seems impossible by definition.


I'll certainly announce any progress on this on this list!

- Konrad.

--
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] Announcing Leibniz, a new language in the Racket universe

2017-04-07 Thread Konrad Hinsen
Now available for your friendly Racket installation: Leibniz, a digital 
scientific notation


What's a digital scientific notation? For those who come from a 
programming language background, it's a specification language for 
scientific computing. However, it is designed for use in documents meant 
for human readers, much like traditional mathematical notation. That's 
why I call it a digital scientific notation, and that's why it is 
implemented as an extension of Scribble.


For all the details, including a manual, see

   https://github.com/khinsen/leibniz

- Konrad

--
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] Racket v6.8

2017-01-25 Thread Konrad Hinsen
Matthew Flatt  writes:

> There's a `raco pkg migrate` command that should do what you want. The
> same functionality is in DrRacket's "File" -> "Package Manager..." ->
> "Copy from Version".

Ahhh... And it works great! I saw this when scanning the output of 
"raco pkg -h" but had the impression that it was for somehow fixing
incompatible packages.

Thanks,
  Konrad.

-- 
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] Racket v6.8

2017-01-25 Thread Konrad Hinsen

On 24/01/17 22:04, Vincent St-Amour wrote:


Racket version 6.8 is now available from

http://racket-lang.org/


That list looks promising - thanks to everybody for the great work you do!


As with every new Racket release, I wonder if there is a straightforward 
way to install all the packages I have installed under 6.7. Something like


  ./6.8/raco pkg install `./6.7/raco pkg show -u`

except that it 1) it works and 2) it handles packages from all sources, 
not just the official catalog.


I'll probably end up hacking something like that myself, but I wonder if 
somebody has already done it?


Konrad.

--
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] Error messages in DSL implementations

2016-10-25 Thread Konrad Hinsen
Thanks to Dmitry, Matthias, and Alexis for their comments, which were
very helpful to understand the principles of error reporting in DSLs.

My summary is (please correct me if I am wrong!):

1) If my DSL code expands to Racket code doing error checking/reporting
   at the top level, the syntax transformers take care of attaching the
   correct source location in the DSL code to the error message.

2) Using expr/c from syntax/parse, I can formulate the error checking
   as a contract and make it part of the syntax transformer, which
   is indeed a good place to have it.

The inconvenience with both of these approaches is that the validation
of the DSL code must be separated completely from the code that
processes it. In my case, which implies traversals of complex graphs,
that means writing nearly identical code but separate code for
validation and processing, and doing some potentially expensive
computations twice. It is probably possible to avoid code duplication by
some refactoring, but the execution time penalty remains.

What I intend to try is to generate an exception-catching wrapper around
my processing code that re-raises the exception from the module's
top-level. I will report on my findings.

Thanks again,
  Konrad

-- 
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] Error messages in DSL implementations

2016-10-24 Thread Konrad Hinsen

Hi Dmitry,


Is it compile-time or run-time errors?


Mostly module-instantiation-time errors, which are closer to run-time 
errors.


As a simple example, consider syntactically correct DSL code that expands to

  (define foo (first '()))

The call to first raises an exception, which is displayed without any 
reference to the original DSL code, and is therefore incomprehensible to 
the DSL's users.


Konrad.

--
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] Error messages in DSL implementations

2016-10-24 Thread Konrad Hinsen

Hi everyone,

I am working on a DSL embedded in Racket (for the curious, it's on 
GitHub: https://github.com/khinsen/leibniz) and as I am starting to use 
my DSL in practice, I wish my implementation had better error reporting.


My DSL consists of a bunch of syntax transformers that expand to Racket 
code that constructs some complex data structure. The errors I care 
about are not syntax errors, but inconsistencies detected during the 
construction of the data structures. I would like those error messages 
to refer to the source of the input language, rather than to the code of 
the DSL implementation, which a DSL user shouldn't have to know about.


I can think of a few approaches, such as redefining 
error-display-handler in the expanded code, but I suspect that others 
have already found better solutions to this problem. I'd be grateful for 
any pointers.


Konrad.


--
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] Re: opinions on YAML as communication tool

2016-10-23 Thread Konrad Hinsen

On 21/10/2016 23:00, Jack Firth wrote:


If you'd still like to use yaml, I would like to quietly point out that each of 
the following is a valid boolean value in yaml:

...

Google for "YAML Norway" for some real-life illustrations of this 
problem. The ISO country code for Norway is "no", which the YAML parser 
converts into "false".


Konrad.

--
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] racket-mode: OK to require Racket 6.0+?

2016-10-11 Thread Konrad Hinsen

On 10/10/16 21:42, Tim Jervis wrote:

Here here!


+1



Tim Jervis
+44 7801 337 078


On 10 Oct 2016, at 19:56, Dmitry Igrishin  wrote:

Hi Greg,

Yes, please! Racket mode for Emacs is great. Thank you for you work!


--
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] Learning by doing Typed Racket

2016-06-13 Thread Konrad Hinsen

On 13/06/2016 03:53, Daniel Prager wrote:


On Mon, Jun 13, 2016 at 10:59 AM, Matthew Butterick > wrote:

Some people, when confronted with a problem, think "I know, I'll use
Typed Racket."  Now they have (Pairof Problem Problem).


Most droll !

Taken seriously, when is the right time for TR vs Contracts vs lots of
tests vs whatever?


And, in the long run, for a synthesis. TR, contracts, and tests are all 
ways to formulate assertions about code. Today, it's the code authors 
who have to learn the subtleties of these different techniques and 
choose between them. I'd prefer to be able to write down all the 
assertions I can reasonably make about my code, and which I consider of 
use for human readers of my code, in a single place and notation, and 
let some program figure what which parts are best verified/enforced 
using which approach and at which time.


In my opinion, this is one main reason why so many programmers still 
prefer dynamic typing. They do see the advantages of having compilers 
perform checks, the more the better, but designing code with the 
idiosyncracies of the type-checkers-of-the-day as top priority isn't a 
very appealing approach.


Konrad.


--
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] DSL to C code generation with symbolic computations en route

2016-04-19 Thread Konrad Hinsen
Jay McCarthy  writes:

> Another thing in this realm is the Terra language ---
> http://terralang.org --- and its associated projects, which are all
> quite beautiful.

Terra was indeed one of my inspirations. Another one, older but closer
to our own universe, is Lush (http://lush.sourceforge.net/).

Konrad.

-- 
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] DSL to C code generation with symbolic computations en route

2016-04-19 Thread Konrad Hinsen

On 18/04/2016 19:20, Dmitry Pavlov wrote:


I, as a programmer in the area of numerics, just evolved to the state
where the following task seem reasonable to work on:

...


I suspect I am not the only one who wants that.


Me too!


There must be some work already done.
What would you advise to start with?


I am not aware of anything very close to your goals in Racketland, but 
there are people much more knowledgeable than me on this list.


I have played with similar ideas as well, but never found the means to 
work on this seriously. But I'd participate in a collaborative project.


My idea for this is:

 1) Define a language with C-level semantics but S-expression syntax. A 
language that can be easily compiled to C, Fortran, LLVM byte code, and 
perhaps even JVM bytecode, in a way that the performance implications of 
each statement are understandable to a software developer.


 2) Develop whatever backends (C, Fortran, LLVM, ...) people find most 
useful. But make sure that at least one backend integrates transparently 
with Racket's FFI, so that one can "just run" such code from Racket.


 3) Develop DSLs that compile to this language.

In the long run, the low-level language could be extended by 
optimization hints, similar to #pragmas as used in OpenMP.


Symbolic derivatives and similar transformations would be part of the 
DSL implementations. For the specific case of derivates, Jerzy's remark 
is important: automatic derivatives are often the better choice. But for 
the big picture, that's a secondary question; a numeric DSL framework 
should support both approaches.


Konrad.

--
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] "table" data structure in Racket

2016-04-06 Thread Konrad Hinsen

On 05/04/2016 21:12, Asumu Takikawa wrote:


I haven't built anything like that, but I was hoping that we could get a GSoC
student for it (that didn't pan out though obviously). The idea was to use
packages from Python/Julia/R as inspiration:

   http://pandas.pydata.org/pandas-docs/stable/index.html
   http://dataframesjl.readthedocs.org/en/latest/
   https://github.com/Rdatatable/data.table/wiki


Also consider this one:

   https://arrow.apache.org/

Konrad.

--
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] racket users fight for their right to colon keywords

2015-10-16 Thread Konrad Hinsen
Matthias Felleisen writes:

 > [I am using past tense because I am sure Fortran is kind of dead
 > now :-).]

There are probably more active Fortran programmers than active Racket
programmers at this time.

 > People wish to conduct a discourse about a domain in the language
 > of their domain, and the more we enable the creation of languages,
 > the closer to the domain language(s) we get.
 > 
 > In the end though, all of these linguistic disconnects can be
 > bridged with a bit of reading code and documentation.

Exactly, just like for human languages. An added condition for
programming languages is interoperability: I am fine with reading
someone else's code in a different dialect, but I certainly do not
want to rewrite it in my own dialect just to be able to use it.

For me the strongest point of Racket is that it encourages linguistic
diversity while maintaining (nearly enforcing) interoperability.  My
dream language environment would go one step further and provide a
second more low-level interoperability layer for performance-oriented
dialects (C/Fortran style).

Konrad.

-- 
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] racket users fight for their right to colon keywords

2015-10-16 Thread Konrad Hinsen
Matthias Felleisen writes:

 > > For me the strongest point of Racket is that it encourages linguistic
 > > diversity while maintaining (nearly enforcing) interoperability.  My
 > > dream language environment would go one step further and provide a
 > > second more low-level interoperability layer for performance-oriented
 > > dialects (C/Fortran style).
 > 
 > 
 > Does the existing FFI provide you with enough efficiency when needed? 

Yes, but I have to write C code outside of Racket. I'd like to be able
to define a #lang in Racket that operates at the level of C
(i.e. machine-level data types, no GC, etc.), and I'd like to generate
specialized code in that low-level language from my standard Racket
code.

Lush (http://lush.sourceforge.net/) has something like that but it
seems kind of dead now. A while ago I saw the annoucement for a new
language called Terra (http://terralang.org/) that is a low-level
complement to Lua, but I haven't taken a closer look yet.

Konrad.

-- 
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] Class constracts and equality

2015-09-11 Thread Konrad Hinsen
Asumu Takikawa writes:

 > On 2015-09-02 08:41:21 +0200, Konrad Hinsen wrote:
 > > That would be great, but if that's not possible, the next-best option would
 > > be to document the restriction.
 > 
 > I now have a pull request that should address this:
 > 
 >   https://github.com/plt/racket/pull/1044

Thanks! I'll try this on my code when I find some time (mainly for installing
Racket from scratch).

 > I've only found one issue with this so far, which is that `object->vector` 
 > can
 > expose the difference between an object produced from a contracted class and 
 > a
 > regular object. This seems minor though.

I assume that object->vector is mainly used by code analysis tools, so
the difference may even be of use. But I'll leave that question to people
who actually use object->vector!

Konrad.

-- 
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] Macro-generating macros

2015-09-04 Thread Konrad Hinsen
Alexander D. Knauth writes:

 > > At least it's one that works. It feels like cheating to use dynamic
 > > scoping to get around a problem with lexical scoping, but knowing when
 > > to cheat is a fundamental competence when dealing with any bureaucracy ;-)
 > 
 > Um, the reason a syntax parameter is better is that it *does*
 > follow the lexical scoping rules, where the unhygienic version does
 > weird things you wouldn't expect. Using datum->syntax is cheating a
 > lot more, and syntax parameters deal with problems like this in a
 > much better way.

I agree that datum->syntax is cheating a lot more, no question.

Still, I just used it, and I don't feel bad about it because it makes
my code a lot more readable. I had gotten to the point of having a
macro introduce generated identifiers as syntax parameters for use by
another macro generated by the first macro as well.

Actually, I felt exactly like when I have to fight a type system: I
know my solution is OK, but the compiler cannot prove it and therefore
rejects it. In those cases I feel entitled to cheat as much as
necessary.

 > P.S.  Have you read Fear of Macros? If you haven't, I highly
 > recommend it because it's awesome.

It is. I had read it a year ago, and now re-read it. I'll probably have
to read it again in the future, but it *is* awesome :-)

Konrad.

-- 
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] Macro-generating macros

2015-09-04 Thread Konrad Hinsen
Brian Mastenbrook writes:

 > It's a capture problem. In the first case, you're just binding the
 > name "send" locally and all is well. In the second case, you're
 > trying to introduce a binding for "send" that you didn't get from
 > the input form.

Ahhh that one has bitten me before, but I had forgotten about it.
Thanks for the reminder!

 > You're also getting a confusing error because "send" is already
 > bound; try using a name that's not already defined and you should
 > get an unbound identifier.

I used a bound symbol intentionally to see if I can shadow an existing
syntax transformer binding.

 > Alternatively, you can use a syntax parameter, which is probably
 > the ideal solution here.

At least it's one that works. It feels like cheating to use dynamic
scoping to get around a problem with lexical scoping, but knowing when
to cheat is a fundamental competence when dealing with any bureaucracy ;-)

Thanks again,
  Konrad.

-- 
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] Macro-generating macros

2015-09-03 Thread Konrad Hinsen
Hi everyone,

Here's another plea for help from the macro experts. I am trying to
write a macro whose expansion contains another macro, more precisely a
let-syntax form. My full example is attached below. In the first part,
I use a let-syntax directly. In the second part, I use a macro that
generates exactly the form that I wrote by hand in the first part -
but then the let-syntax seems to be ignored.

The macro stepper isn't of much help here. It shows the expansion
of (defn (foo2 ...)) into essentially what I wrote by hand for foo1,
and then declares the expansion finished.

Can anyone tell me (1) why this doesn't work and (2) how to fix it?

Thanks in advance,
  Konrad.

==
#lang racket

(require syntax/parse)
(require (for-syntax syntax/parse))

;
; this works fine
;
(define (foo1 x y)
  (let-syntax ([send (λ (stx)
   (syntax-parse stx
 ((send obj:expr method:id x:expr ...)
  #'(method obj x ...])
(send x + y)))

(foo1 2 3)

;
; this doesn't
;
(define-syntax (def stx)
  (syntax-parse stx
[(_ (fn-name:id arg:id ...) body ... )
 #'(define (fn-name arg ...)
 (let-syntax ([send (λ (stx)
  (syntax-parse stx
[(send obj:expr method:id x:expr (... ...))
 #'(method obj x (... ...))]))])
   body ...))]))

(def (foo2 x y)
  (send x + y))

(foo2 2 3)

;; send: target is not an object
;; ;   target: 2
;; ;   method name: +
;; ;

-- 
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] Lost in ellipsis depths

2015-09-03 Thread Konrad Hinsen
Jens Axel Søgaard writes:

 > Here are two variations:
...

Alexander D. Knauth writes:

 > To make it look a little less messy, here's what I would do for stuff like 
 > this:
...

Matthias Felleisen writes:

 > I think you want either this:
...

Ryan Culpepper writes:

 > Here's one more solution, using "template metafunctions" (inspired by 
 > Redex's metafunctions). And yes, most of the point of template 
 > metafunctions is to have something that cooperates with ellipses like 
 > you want.


Thanks to all of you for your suggestions!  For my current ten-line macro,
I'll go with stx-map, but I really like Ryan's template metafunctions for
more complex situations, which I expect to run into quite soon.

Konrad.

-- 
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] Class constracts and equality

2015-09-02 Thread Konrad Hinsen
Hi Asumu,

 > In particular, the code for class contracts explicitly installs a value for 
 > the
 > inspector that doesn't allow inspection (there's a comment saying "No
 > inspection").

Thanks for exploring this, at least I now know what's going on!

 > But maybe it's worth revisiting this part of the design. I can look into if
 > it's possible to have the contracted class inherit the inspect of the 
 > original
 > and whether that causes any problems.

That would be great, but if that's not possible, the next-best option would
be to document the restriction.

For now I'll remove the contract, as equality checking is clearly more
important for me.

Konrad.

-- 
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] Lost in ellipsis depths

2015-09-02 Thread Konrad Hinsen
Konrad Hinsen writes:

 > In fact, what I want is do something like map over the ellipsis pattern,
 > but I haven't seen any example for doing this.

Well, map actually works:

  (syntax-parse #'(foo a b c)
[(f:id s:id ...)
 (with-syntax ([(foo-s ...)
(map (λ (x) (format-id #'f "foo-~a" x)) (syntax-e #'(s ...) 
))])
   #'(list foo-s ...))])

But is this the only solution? It looks a bit messy.

Konrad.

-- 
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] Lost in ellipsis depths

2015-09-02 Thread Konrad Hinsen
Hi everyone,

I am working on what I consider a simple macro, but after reading all
of the macro-related documentation twice, I still don't see how to do
this.

I want to transform

  (foo a b c)

to

  (list foo-a foo-b foo-c)

Here is my best attempt (using syntax/parse):

(syntax-parse #'(foo a b c)
  [(f:id s:id ...)
   (list (format-id #'f "foo-~a" #'s) ...)])

This yields the error message

  syntax: missing ellipsis with pattern variable in template

In fact, what I want is do something like map over the ellipsis pattern,
but I haven't seen any example for doing this.

Help, please!

Thanks in advance,
  Konrad.

-- 
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] Class constracts and equality

2015-09-01 Thread Konrad Hinsen

On 01/09/15 18:45, Daniel Feltey wrote:


I think this is expected, if you want to check for equality on instances
of contracted classes you should use the `object=?` function which can
"see through" the contract wrappers.

http://docs.racket-lang.org/reference/objectutils.html?q=object%3D%3F#%28def._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._object~3d~3f%29%29


Thanks for the reference, but my interpretation of this is different. I 
don't care about eq?, nor about testing how objects were created. I want 
comparison by equal? by recursive application to the fields - just as 
for transparent structures.


Konrad.

--
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] Class constracts and equality

2015-09-01 Thread Konrad Hinsen
Hi everyone,

I am trying to add a contract to a class but find that the mere presence
of the contract breaks my code. Here is a minimal example that illustrates
the problem:

--
#lang racket

(define foo%
  (class object%
(inspect #f)
(super-new)
(init-field value)))

(define/contract foo+c%
  (class/c (init [value symbol?]))
  foo%)

(module+ test
  (require rackunit)
  (check-equal? (make-object foo% 'bar)
(make-object foo% 'bar))
  (check-equal? (make-object foo+c% 'bar)
(make-object foo+c% 'bar)))
--

My class foo% declares (inspect #f) to ensure that foo% objects can be
compared using equal?. As the test shows, this works fine. However, as
soon as I add a contract to my class, equality tests fail
systematically.

Am I using class contracts incorrectly? Or is this a bug, or a
feature?  Is there a workaround?

Thanks in advance,
  Konrad

-- 
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] Literate programming and submodules

2015-08-24 Thread Konrad Hinsen

On 08/08/2015 16:59, Matthew Flatt wrote:


The problem here is the same as in

  https://groups.google.com/d/msg/racket-users/H7vilh3KcD4/pGZif3F3dEkJ


Indeed, adding that require line fixes the problem. Thanks!


I still haven't thought about it enough to fine better solution than
putting `require (only-in racket/base #%module-begin))` before the
submodule declaration.


I'll profit from this situation for a feature request that looks somehow 
related: it would be nice if I could specify somewhere the  bindings for 
my module as something other than racket/base. For example racket or 
lazy.


In fact, if I write (require racket) instead of (require (only-in 
racket/base #%module-begin)), I gain in two ways:

 - I get all the bindings I expect.
 - It looks much less like a kludge.

It would then make sense to have something like

 @bindings[racket]

at the top of my scribble/lp2 module to put this information in a more 
prominent place.


Konrad.

--
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] Literate programming and submodules

2015-07-30 Thread Konrad Hinsen

Hi everyone,

I have been testing literate programming in Racket recently (#lang 
scribble/lp2), and found it overall quite nice - until I wanted to 
include tests in the usual way, by creating a submodule test:


==
#lang scribble/lp2

@chunk[drop
   (define (drop t)
 (* 1/2 9.8 t t))]

@chunk[test-drop
   (check-= (drop 0) 0 ε)
   (check-= (drop 10) 490 ε)]

@chunk[to-energy
   (define (to-energy m)
 (* m (expt 299792458.0 2)))]

@chunk[test-to-energy
   (check-= (to-energy 0) 0 ε)
   (check-= (to-energy 1) 9e+16 1e+15)]

@chunk[*
   (provide drop to-energy)
   drop
   to-energy
   (module* test #f
 (require rackunit)
 (define ε 1e-10)
 test-drop
 test-to-energy)]
==

This is a straightforward conversion of a submodule example from the 
Racket guide to #lang scribble/lp2. But it doesn't work, because the 
bindings drop and to-energy are not visible inside the test submodule.


Given that scribble uses submodules itself, I am not sure if this is 
supposed to work. What I am more interested in is finding a workaround. 
Is there some way to combine literate programming and testing using 
raco test?


Konrad.

--
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] Gear VR

2015-07-02 Thread Konrad Hinsen

On 02/07/2015 19:50, Matthias Felleisen wrote:


Let me add one thought here. One of the thoughts I have played with in this 
context is to have a dissertation on XML-style type extensions for Typed Racket 
(CDuce, XDuce). I am not interested in XML (or JSON) per se but in type systems 
that can say more about S-expression-like data. Of course, as in the past, this 
would have to be balanced between theoretical expressive power and practical 
expressiveness/impact. (We tend to err in the direction of the former, because 
we finance Racket via research grants.)


That reminds me of an approach that is more than 20 years old:

  http://www.sciencedirect.com/science/article/pii/030439759290302V

That kind of type system should fit many kinds of s-expressions nicely.

Konrad.

--
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] System Scheme (RnRS): Shared Secret Generator

2015-06-12 Thread Konrad Hinsen

On 12/06/15 09:15, Michael Titke wrote:


In my understanding the pseudo random number generator is deterministic.
That means for the same input seed /random/ will always return the same
value. This is why one usually has to set a new state for each call of
random.


No, quite on the contrary.

Before going on, please note that I never looked at the specific random 
generator used by Racket. I assume it's one of the popular random number 
generator algorithms. For what follows, it doesn't even matter which one.


All pseudorandom generators produce a sequence of numbers. The intention 
is that the sequence should have as little detectable correlation as 
possible. The algorithms differ in how they define this goal exactly, 
and how well they reach it.


The principle behind all these generators is a chaotic dynamic process 
that transforms the current state of the generator (some finite number 
of bits) into a new state, which is used for the next call. The returned 
value is some function of the state. Setting a new seed changes to state 
to some function of the seed value.


Seeding is provided for two use cases: 1) Reproducibility, mainly for 
software testing. If you set the seed to some constant at the start of 
your program, it will behave exactly the same way whenever it is run. 2) 
Real randomization, by setting the seed from some unpredictable 
source, such as the system time. In both cases, the idea is to set the 
seed once at the beginning of a program run.


The statistical properties of the pseudo-random sequence hold only for 
an unperturbed sequence, i.e. without changing the seed. If you set the 
seed every time you ask for a random number, your random sequence 
becomes simply some complicated function of your input seed, whose 
statistical properties are hard to predict and most probably not what 
you want.


Konrad.

--
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] System Scheme (RnRS): Shared Secret Generator

2015-06-12 Thread Konrad Hinsen

On 12/06/2015 15:35, Michael Titke wrote:


That does not explain the bias, I guess. I repeat: But IMHO a function
(random n state/generator) should guarantee a common saturation of the
destination space when the current state is filled with real randomness.


I have never seen such a criterion for the seeding procedure of any 
random generator. It's not an unreasonable expectation, but I don't 
think any implementation actually makes such a promise.



Do you really think that seeding with numbers from an entropy pool would
create such a strong bias. I don't think so.


I have no opinion about this. But I do remember Knuth's warning never to 
choose a random number generator at random. It's very hard to predict 
the impact of any change.


Konrad.

--
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] Persistent vectors: a generic collections proof-of-concept

2015-05-29 Thread Konrad Hinsen

On 28/05/2015 09:59, Alexis King wrote:


As a followup to my last thread regarding my generic collections library, I 
have now created a package that uses it to define an entirely new data 
structure. I've implemented Clojure's 32-way bitmapped tries to create a 
persistent vector implementation. If you're interested in trying it out, it's 
available as a package under the name ‘alexis-pvector’.


How does this compare to https://github.com/ijp/pfds/ or the work 
described in http://www.ccs.neu.edu/racket/pubs/sfp10-kth.pdf ?


Konrad.

--
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] Persistent vectors: a generic collections proof-of-concept

2015-05-29 Thread Konrad Hinsen
Alexis King writes:
   How does this compare to https://github.com/ijp/pfds/ or the work 
   described in http://www.ccs.neu.edu/racket/pubs/sfp10-kth.pdf ?
  
  In the case of the former, that targets R6RS, while this is
  intended to be a more “native” Racket solution. The latter is in
  Typed Racket, while this is currently in untyped Racket since TR

Thanks for this concise summary, that was exactly what I was hoping
for.

  In addition to the actual implementation differences, this is also
  designed with my generic collections library in mind to test the

I just looked at that one and it seems really nice - the Clojure
inspiration is hard to miss ;-) I always found Racket's collection
to be unpleasant to use because of the many different interfaces,
which in particular force programmers to commit to a specific choice
early in program design.

I'll put both the generic collections and the persistent vectors on my
to-do list!

Konrad.

-- 
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] Implementing a lazy for/stream using for/fold/derived and delimited control

2015-05-20 Thread Konrad Hinsen

On 20/05/2015 04:24, Alexis King wrote:


I'm trying to implement a for/stream loop using for/fold/derived that will 
return a lazy stream, as would be expected. One way to do this is by using 
delimited control, which is what I'm currently trying. If there's an easier 
way, let me know, but I'd still like to figure this out as a pedagogical 
exercise.


If I understand correctly what you are trying to do, the simplest 
solution seems to be a generator.


=
#lang racket

(require racket/generator)

(define result-stream
  (in-generator
   (for ([i (in-naturals 10)])
 (yield i

(for ([n result-stream])
  (printf ~s\n n))
=

This example is a bit pointless because result-stream could just as well 
be replaced by (in-naturals 10), but I hope it is clear how this could 
be generalized to a meaningful application.


I use this a lot, to the point of considering defining something like 
for/sequence to have nicer syntax for this.


Konrad.

--
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] Re: [racket] How to call a Julia function from DrRacket?

2015-05-03 Thread Konrad Hinsen

On 03/05/2015 00:00, Geoffrey Knauth wrote:


On Friday, May 1, 2015 at 5:53:04 PM UTC-4, Greg Trzeciak wrote:

It's an old thread but just in case someone is looking for the answer Julia has 
(now?) C API:
http://julia.readthedocs.org/en/latest/manual/embedding/


I hesitate to mention connecting Racket to Fortran some day but I wonder if 
that's ever been done.  Nine years ago when I worked on parallel programming 
enhancements to Octave, the free MATLAB-workalike written in C++, Octave leaned 
heavily on Fortran scientific libraries that had been highly optimized over 
decades.  Julia is also speedy doing math.


If it's old Fortran 77 code (BLAS, LAPACK, etc.), C interfacing 
techniques work quite well in practice. You have to know how the Fortran 
compiler's API maps to a C API, but there are only two or three 
conventions around, which differ in trivial things like underscores 
added to subroutine names. Fortran 95 and later are a different story.


Konrad.

--
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] syntax-parse and optional keywords

2015-04-20 Thread Konrad Hinsen
   I want to define some syntax with an optional keyword but no arguments
   behind it. Something like #:mutable in struct. The pattern seems
   obvious:
   
 (~optional #:my-keyword)
   
   but I don't see how I can detect the presence or absence of the
   keyword in the code that I generate. There is no attribute for
   which I could define a default.

Thanks to all who sent suggestions! They led me to the section on action
patterns in the manual, which I hadn't explored before.

Konrad.

-- 
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] Organizing tests

2015-04-17 Thread Konrad Hinsen
Thanks to Matthias, John, and Greg for their suggestions! I explored
the raco documentation in more detail and I will try to come up with
some good solution. My main goal is to have convenient modes of operation:

1) Developers (currently me) should be able to run easily the
   subset of tests that is relevant for their current work.

2) Users and occasional contributors should be able to run easily
   the entire test suite of my collection/library.

Matthias Felleisen writes:

  Use different names for the various test modules. 
  At the local level, you can use module+ test. For
  the integration tests, you may wish to use module+
  integration.

Given that I frequently split modules as my code base grows,
I'd like to avoid having integration tests in any one module,
and prefer a specific module for the tests (that doesn't change).
However, it just occurred to me that nothing prevents me from
having a module that is empty except for a test submodule.
I'll see if that works for me.


John Clements writes:

  The ‘raco test’ tool can be applied to a collection, using the
  “—collection” (or simply “-c”) flag. You can see a full list of the
  available flags by running
  
  raco help test

True, but it isn't terribly clear what interpreting arguments as
collections means. The Racket documentation is a bit more precise in
saying that a collection is treated like a dictionary containing
modules, so it's just another way to specify a directory path.


Greg Hendershott writes:

  I did `raco help test` just now and discovered even more options than
  I remembered. Including fun things like running tests in parallel,
  printing a summary table, and so on.

It's indeed quite feature-rich.

  racket-mode has a couple features related to tests and coverage. They
  currently assume the module is `test`. That's been sufficient for me
  so far, and I handle more exotic test things in a Makefile. But feel

I think it will be sufficient for me as well. In racket-mode, I mainly
want to run one module's unit tests. If I can integrate them into
a global test-running scheme with raco, that's all I expect to need.


Konrad

-- 
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] syntax-parse and optional keywords

2015-04-17 Thread Konrad Hinsen
Hi everyone,

my question looks like something straightforward, but I have been
reading through the documentation for a while without finding anything
clearly helpful.

I want to define some syntax with an optional keyword but no arguments
behind it. Something like #:mutable in struct. The pattern seems
obvious:

   (~optional #:my-keyword)

but I don't see how I can detect the presence or absence of the
keyword in the code that I generate. There is no attribute for
which I could define a default.

Konrad.


-- 
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] Organizing tests

2015-04-16 Thread Konrad Hinsen
Hi everyone,

I want to put some order into my tests, but after looking at various
published Racket packages, I am not sure if there any accepted best
practices.

For a single module, the best approach seems to be a submodule test
for the test cases, which are then run by raco test. That's nice and
works fine.

But what I have is a collection with multiple modules. Each modules
has local tests, but there are also tests at a higher level that use
code from several modules.

I am looking for an approach that lets me run either all tests in my
collection, or convenient subsets (e.g. one module), ideally using a
single tool such as raco test. Any suggestions? You get bonus points
for solutions that integrate well with racket-mode in Emacs.

Thanks in advance,
  Konrad.

-- 
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 Racket manifesto

2015-03-27 Thread Konrad Hinsen
Matthias Felleisen writes:

   A web site is an ad.
   
   As is a research paper. It's the audience that differs.
  
  I am sorry but you embrace modern CS departments too much, 
  and there is push-back coming about. Don't bother me with 
  papers that I can't reconstruct and accept after that as 
  valid or invalid. 

I am activist in the Reproducible Research movement as well, so I
fully agree.  But this is my dream for the future, not the present I
live in. In my field of work (biomolecular simulation), it is even
technically impossible to publish most research in a form that allows
readers to reconstruct everything from published code. In fact,
my current Racket project is about improving this situation.

  See Grow Your Language. Let us know what you think. 

Oops - I hadn't seen that one. My default landing page for Racket is
docs.racket-lang.org.

Yes, this looks good. The link to section 17 of the Racket Guide is
great for getting people started!

Konrad.

-- 
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 Racket manifesto

2015-03-27 Thread Konrad Hinsen
Matthias Felleisen writes:

   A web site is an ad.
   
   As is a research paper. It's the audience that differs.
  
  I am sorry but you embrace modern CS departments too much, 
  and there is push-back coming about. Don't bother me with 
  papers that I can't reconstruct and accept after that as 
  valid or invalid. 

I am activist in the Reproducible Research movement as well, so I
fully agree.  But this is my dream for the future, not the present I
live in. In my field of work (biomolecular simulation), it is even
technically impossible to publish most research in a form that allows
readers to reconstruct everything from published code. In fact,
my current Racket project is about improving this situation.

  See Grow Your Language. Let us know what you think. 

Oops - I hadn't seen that one. My default landing page for Racket is
docs.racket-lang.org.

Yes, this looks good. The link to section 17 of the Racket Guide is
great for getting people started!

Konrad.

-- 
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] Projects (was: the Racket manifesto)

2015-03-26 Thread Konrad Hinsen
Laurent writes:

  Furthermore, files and github are not chosen by Racket, so I don't
  personally mind that much using a few external tools if Racket
  can't do it itself (I'd still rather have Racket do it itself of
  course; I want a Racket machine). What's more, whether `raco` is

I'd go one step further and say that for some tasks I prefer to use
external tools, and the possibility of doing so if very important for
me.

The point is that much of what I do on my computer is outside of the
scope of Racket, so I need to integrate Racket into my overall
workflow. I edit lots of file, including Racket source code, so I much
prefer to use Emacs for everything, even though DrRacket is perhaps
superior for writing Racket code. I use version control for almost
everything I work on, so I prefer standard tools (Mercurial, Git),
even if Racket one day comes with built-in version control.

The idea of creating an all-encompassing programming environment has
been tried a few times in the past. Lisp machines have
disappeared. Smalltalk is insignificant. For now, Racket has found a
good compromise and I hope it will stay there.

Konrad.

-- 
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 Racket manifesto

2015-03-26 Thread Konrad Hinsen
Matthias Felleisen writes:

  Neil, I wrote this paper _because_ academia perceives Racket as a cult. 

Wow. I must be missing something interesting. Is there some tutorial
on the Rites of Racket?  ;-)

I am in academia, but quite remote from the Racket hotspots both
thematically and geographically. As far as I can remember, I have
never spoken to anyone in real life who uses Racket or who just knows
a Racket user in person. From this distant point of view, Racket looks
like a community of people working on a common goal, and the manifesto
describes that goal very well.

What strikes me is that the manifesto gives a very different view of
Racket than the Racket Web site does. The latter emphasizes Racket as
a teaching environment and as a batteries included general-purpose
language. The features related to language development are documented
in the reference sections, but there isn't much to motivate them. It's
only from the manifesto that I started to see the point of having
inspectors and custodians, for example.

In my opinion, it would be interesting to develop a pedagogical
approach to the language development theme in the form of tutorials,
books, or presentations. Maybe even a teaching language with a
simplified version of syntax/parse. The goal would be both to lower
the entry barrier to the most interesting aspects of the Racket
universe, and to gain insight by teaching, i.e. find better ways
to do things in the future.

Konrad.

-- 
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 Racket manifesto

2015-03-26 Thread Konrad Hinsen
Matthias Felleisen writes:

  Here we go:
  
  0. open drracket 
  1. type (
  2. hit return
  3. stare at the two spaces of indentation in sheer amazement 
  4. relax, type )
  
  Smile. Now you're a Racketeer. 

Thanks - now I feel enlightened!

  A web site is an ad.

As is a research paper. It's the audience that differs.

  It is for the programmer looking for a productive tool. As such,
  the site needs to clarify that
  
  -- Racket is an ordinary programming language 
   (see sentence 1 in section 3)
  -- it brings something to the table that is an increment over others 
  (full-spectrum)
   (see section 4 plus section 5)
  -- you can do truly unusual things with it (grow your language) 
   (see section 3) 

I'd say it does (1) very well, (2) reasonably well, and (3) not at
all.  If you know about (3) you can find the details, but even that
requires some effort.

Konrad.

-- 
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.