Re: [racket] Inconsistency of `in-range` and numerical issues

2015-02-24 Thread Konrad Hinsen
On 24/02/2015 16:41, Laurent wrote: I've discovered a rather troubling behaviour when using `in-range` with floating point numbers, which I think is worth knowing in case you hadn't consider the issue before: On my machine, I get the following: (length (for/list ([i (in-range .1 .7 .1)]) i)) ;

Re: [racket] Inconsistency of `in-range` and numerical issues

2015-02-24 Thread Konrad Hinsen
On 24/02/2015 17:04, Laurent wrote: Btw, the reason it outputs 8 in the bad case is because on my machine: (for/sum ([i 8]) .1) ; 0.7999 which is then below the .8 threshold. It's not just your machine. 0.1 = 1/10 does not have an exact representation as a binary floating-point n

Re: [racket] Inconsistency of `in-range` and numerical issues

2015-02-25 Thread Konrad Hinsen
On 24/02/2015 23:01, Steve Graham wrote: While I don't doubt the facts presented below, it just seems wrong, notwithstanding what the standard states. You are not alone in considering that there is something wrong with how IEEE 754 floating-point operations work. Floats are indeed counter-in

Re: [racket] racket-mode

2015-02-25 Thread Konrad Hinsen
On 24/02/2015 23:02, Greg Hendershott wrote: Just a heads-up on some progress with racket-mode over the last couple months: ... If you have really detailed questions, or problem reports, it would probably be better for this list (and easier for me to track them) if you lob them to GitHub Issu

Re: [racket] Inconsistency of `in-range` and numerical issues

2015-02-26 Thread Konrad Hinsen
Alexander D. Knauth writes: > > 1) read-decimal-as-inexact could be #f by default, preferring exactness > > over efficiency by default. > > I just made a meta-language that does this: > https://github.com/AlexKnauth/exact-decimal-lang > The teaching languages also do this, but this can be

Re: [racket] Inconsistency of `in-range` and numerical issues

2015-02-27 Thread Konrad Hinsen
On 26/02/2015 15:13, Neil Toronto wrote: The second alternative is a little harder to get right because of fencepost errors [1]. Fortunately, Racket has a library function for it. Unfortunately, it's buried in `plot/utils`. Here it is in action: > (require (only-in plot/utils linear-seq)) >

Re: [racket] Inconsistency of `in-range` and numerical issues

2015-02-27 Thread Konrad Hinsen
Robby Findler writes: > Should we consider making in-range signal an error for floats? I > guess backwards compatibility says "no" but maybe in a future > racket? With a note in the error message that points people in the > right direction? In a future Racket or perhaps in a specialized langu

Re: [racket] racket-mode

2015-02-28 Thread Konrad Hinsen
On 28/02/2015 16:33, Greg Hendershott wrote: Sure, I hardly ever want a debugger for Racket, in the way I used one heavily and religiously for C/C++ (to step through new code the first time instead of just hitting Run). After all we have the REPL, and functions. And TBH printfs usually suffice.

[racket] Crowdsourcing Pict3D's design

2015-03-10 Thread Konrad Hinsen
Neil Toronto writes: > Pict3D is finally ready for public consumption. You can install the > package either in DrRacket using "File -> Install Package..." or from > the command line using > > raco pkg install pict3d This looks quite impressive - thanks! Where can I download some spa

Re: [racket] Crowdsourcing Pict3D's design

2015-03-11 Thread Konrad Hinsen
On 11/03/15 02:38, Jack Firth wrote: This happens on my OS X machine as well, in precisely the same way. Me too. I didn't notice before because I didn't know it should work. I was just disappointed that I couldn't navigate with the mouse. On 11/03/15 02:39, Neil Toronto wrote: > If you nee

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 on

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 geographicall

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

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 af

[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 ni

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

[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

Re: [racket-users] syntax-parse and optional keywords

2015-04-19 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 t

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

Re: [racket-users] Implementing a lazy for/stream using for/fold/derived and delimited control

2015-05-19 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 s

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.

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 >

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

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 fo

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 s

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

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 `requ

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

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#%28d

Re: [racket-users] Class constracts and equality

2015-09-01 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

[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

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

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

[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 generat

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

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

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: > > ht

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

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

[racket-users] Feasibility of Racket for scientific and engineering calculations

2015-11-03 Thread Konrad Hinsen
John, > I am exploring whether Racket could be a Lisp replacement for > Python in scientific and engineering calculations. I currently use > Python extensively in teaching chemical engineering courses > (http://kitchingroup.cheme.cmu.edu/pycse/) and in running molecular > simulations (http://

Re: [racket-users] Re: code reflection

2017-10-16 Thread Konrad Hinsen
On 16/10/2017 23:11, Matthias Felleisen wrote: Lisp macros are easier than Racket’s in the same way that it was so much easier to write procedures in ASM than in Pascal. Having used both, I fully agree, but I also wonder if it is possible to restore *some* of the simplicity of Lisp macros in

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 familia

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

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,

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

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://stackove

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 reas

[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 alloca

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

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! Ko

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

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 l

Re: [racket-users] Using Racket's raco on on Guix(SD)

2018-05-23 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

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

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, t

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

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 hav

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,

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.

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 exam

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 memor

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 usi

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 pr

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

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 s

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/)

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 mailto:m...@mbtype.com>> 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, whe

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 "R

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

[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 Rac

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

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 tra

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 package

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 t

[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 mean

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 defin

Re: [racket-users] Announcing Leibniz, a new language in the Racket universe

2017-04-10 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 e

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 wa

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 cl

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

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 defin

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/in

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

Re: [racket-users] Announcing Leibniz, a new language in the Racket universe

2017-04-26 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 o

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.

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

Re: [racket-users] European Racketeers and conferences

2017-08-22 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.

[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

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

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

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

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

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

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.

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 tryin

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 rig

[racket] Another Canonical Use of Macros?

2013-11-22 Thread Konrad Hinsen
John Clements writes: > categorizing them in terms of the "three canonical categories" that > Matthias described--apologies if I'm misrepresenting him/you: > - changing evaluation order, > - implementing a data sublanguage, and > - creating new binding forms. > > Some of the Rust macros se

Re: [racket] How to call a Julia function from DrRacket?

2014-02-02 Thread Konrad Hinsen
Neil Toronto writes: > Enrique, if you don't mind my asking, where does Racket's math library > fall short for the study you have in mind? (Its floating-point support > shouldn't, especially if you work in Typed Racket.) I'm one of its > authors, so I'm looking for suggestions. >From my ow

Re: [racket] Formal Presentation and initial doubts.

2014-03-22 Thread Konrad Hinsen
--On 22 mars 2014 04:18:03 -0400 Neil Van Dyke wrote: One tip for writing macros: make your transformer pattern variables be all-uppercase. This convention makes reading and writing macros much easier for humans, and also less confusing to learn (because people seeing examples are less confuse

[racket] Using Racket 6.0 through a Web proxy

2014-03-31 Thread Konrad Hinsen
Hi everyone, I just installed Racket 6.0 on a new machine (MacOS 10.9), without any problems. However, I didn't yet succeed in installing any packages from the package catalog. I suspect that this is due to the Web proxy that I have to use in my office. My first attempt was to use raco: raco

  1   2   3   >