Re: [racket-users] How to test that a file is syntactically correct, but don't run it
Or check out Shill. It may just be what you want. — Matthias > On Nov 26, 2016, at 3:45 PM, Alexis Kingwrote: > > Many of the other answers here are good, but I want to try and give a > couple more options and a little more context. > > First of all, in Racket, the phrase “syntactically correct” is a little > bit vague. It could mean that a program is successfully parsed from text > to s-expressions, which is the reader step, or it could mean that > macroexpansion completes successfully. The former definition is the more > traditional definition of “syntactically correct”, but being able to > parse an AST means little in a language where the code effectively is > the AST. For that reason, something like (define) is obviously a “syntax > error”, but it’s perfectly valid from the reader’s point of view. > > So the question is, which of the two things do you want to check? > Obviously, checking if macros properly expand is a strictly stronger > check than checking if the program is properly read. > > - If you want to check that a program is properly read, you can use >`raco read` from the command line, or you can use `read` in >combination with with-module-reading-parameterization from >syntax/modread to achieve something similar programatically. > > - If you want to check that a program properly macroexpands, you can >use `raco expand` from the command line, or you can use `expand` on >the value produced by the previous step after setting >current-namespace to (make-base-namespace). > > However, be aware of the implications of both of these things! > Performing macroexpansion on a program can have arbitrary side-effects. > It’s perfectly possible to write a macro that will open an HTTP > connection and send all your private data over the wire. For this > reason, macroexpansion is no safer than actually running the program, so > you should do it in a sandbox if you are running arbitrary > user-submitted code. > > In contrast, the reader step seems safe, but it’s actually not. Due to > the existence of #lang and #reader, users can supply arbitrary readers > for their programs, which can also run arbitrary code. If you do not > need to support arbitrary #lang languages, you could set > read-accept-reader and read-accept-lang to #f, then do the reading > yourself, and that would be safe, but then you can’t use > with-module-reading-parameterization mentioned above. > > If you are going to run either of the two steps above using the > command-line tools, I would recommend that you run them inside a virtual > machine with no network access or access to the host filesystem. You > could also use the programmatic approach and use racket/sandbox, which > allows restricting what programs can do, but I don’t claim to know how > strong the security guarantees are that racket/sandbox provides. > > (Of course, if you’re running arbitrary code, anyway, then you are > probably aware of those things. I just want to make it clear that using > this as a “safe precheck” is not a valid assumption for future readers > who might stumble upon this thread.) > > Alexis > >> On Nov 25, 2016, at 17:28, David Storrs wrote: >> >> As part of my pre-checkin test suite I'd like to be able to check that all >> files are syntactically correct, but I don't want to actually execute them >> because, e.g. executing 'server.rkt' would start the server and I don't want >> that. Is there a way to do this? Nothing I see under 'raco help' or the >> racket docs suggests a solution. >> >> -- >> 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. > > -- > 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. -- 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] Best alternate editor/IDE for someone who gets overwhelmed by complexity
The documentation site includes links to PDFs. You could print — Matthias > On Nov 26, 2016, at 3:22 PM, SRwrote: > > The "Program Contour" feature is another revelation! I appreciate, finally, > why those "pesky" many-line declarations of things like > ;;; > ; ;;; ; ;; ; ; ;; ; > ; ; ; ; ;; ; ; ; ; ;; ; ; ; > ; ; ; ; ; ; ;; ; ; ; ; ;; > ; ; ; ; ; ; ;; ; ; ; ; ;; > ; ; ; ; ; ; ; ; ; ;; ; ; ; ; > ; ;;; ; ; ;;; ;; ; ; ;;;; > ; > > are there! ;-/ That's cool! > > Partly out of bad habits and partly out of the way the racket documentation > is segmented I obviously haven't read it thoroughly enough. I just spent a > few minutes searching Amazon and elsewhere for a bound or kindle-downloadable > book of documentation. Yes, I found plenty of documentation in HTML form - > but is there an expanded form where I can read it more conventionally and > carefully at my leisure? I would be willing to pay for it...cause I'm > obviously paying for by other means! :-) > > -- > 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. -- 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: Best alternate editor/IDE for someone who gets overwhelmed by complexity
Go to menu item: edit, preferences, background-expansion and enable it. Sometimes it is necessary to close and reopen DrRacket to get the choices active. Jos -Original Message- From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com] On Behalf Of SR Sent: sábado, 26 de noviembre de 2016 21:41 To: Racket Users Subject: [racket-users] Re: Best alternate editor/IDE for someone who gets overwhelmed by complexity Jos, What is "background expansion" and how do I turn it on to see if it helps me? I just did a search of help and didn't find the term. I did look around in view but don't see that as a choice. -- 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. -- 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] How to test that a file is syntactically correct, but don't run it
Many of the other answers here are good, but I want to try and give a couple more options and a little more context. First of all, in Racket, the phrase “syntactically correct” is a little bit vague. It could mean that a program is successfully parsed from text to s-expressions, which is the reader step, or it could mean that macroexpansion completes successfully. The former definition is the more traditional definition of “syntactically correct”, but being able to parse an AST means little in a language where the code effectively is the AST. For that reason, something like (define) is obviously a “syntax error”, but it’s perfectly valid from the reader’s point of view. So the question is, which of the two things do you want to check? Obviously, checking if macros properly expand is a strictly stronger check than checking if the program is properly read. - If you want to check that a program is properly read, you can use `raco read` from the command line, or you can use `read` in combination with with-module-reading-parameterization from syntax/modread to achieve something similar programatically. - If you want to check that a program properly macroexpands, you can use `raco expand` from the command line, or you can use `expand` on the value produced by the previous step after setting current-namespace to (make-base-namespace). However, be aware of the implications of both of these things! Performing macroexpansion on a program can have arbitrary side-effects. It’s perfectly possible to write a macro that will open an HTTP connection and send all your private data over the wire. For this reason, macroexpansion is no safer than actually running the program, so you should do it in a sandbox if you are running arbitrary user-submitted code. In contrast, the reader step seems safe, but it’s actually not. Due to the existence of #lang and #reader, users can supply arbitrary readers for their programs, which can also run arbitrary code. If you do not need to support arbitrary #lang languages, you could set read-accept-reader and read-accept-lang to #f, then do the reading yourself, and that would be safe, but then you can’t use with-module-reading-parameterization mentioned above. If you are going to run either of the two steps above using the command-line tools, I would recommend that you run them inside a virtual machine with no network access or access to the host filesystem. You could also use the programmatic approach and use racket/sandbox, which allows restricting what programs can do, but I don’t claim to know how strong the security guarantees are that racket/sandbox provides. (Of course, if you’re running arbitrary code, anyway, then you are probably aware of those things. I just want to make it clear that using this as a “safe precheck” is not a valid assumption for future readers who might stumble upon this thread.) Alexis > On Nov 25, 2016, at 17:28, David Storrswrote: > > As part of my pre-checkin test suite I'd like to be able to check that all > files are syntactically correct, but I don't want to actually execute them > because, e.g. executing 'server.rkt' would start the server and I don't want > that. Is there a way to do this? Nothing I see under 'raco help' or the > racket docs suggests a solution. > > -- > 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. -- 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] Re: Best alternate editor/IDE for someone who gets overwhelmed by complexity
Jos, What is "background expansion" and how do I turn it on to see if it helps me? I just did a search of help and didn't find the term. I did look around in view but don't see that as a choice. -- 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] Re: Best alternate editor/IDE for someone who gets overwhelmed by complexity
The "Program Contour" feature is another revelation! I appreciate, finally, why those "pesky" many-line declarations of things like ;;; ; ;;; ; ;; ; ; ;; ; ; ; ; ; ;; ; ; ; ; ;; ; ; ; ; ; ; ; ; ; ;; ; ; ; ; ;; ; ; ; ; ; ; ;; ; ; ; ; ;; ; ; ; ; ; ; ; ; ; ;; ; ; ; ; ; ;;; ; ; ;;; ;; ; ; ;;;; ; are there! ;-/ That's cool! Partly out of bad habits and partly out of the way the racket documentation is segmented I obviously haven't read it thoroughly enough. I just spent a few minutes searching Amazon and elsewhere for a bound or kindle-downloadable book of documentation. Yes, I found plenty of documentation in HTML form - but is there an expanded form where I can read it more conventionally and carefully at my leisure? I would be willing to pay for it...cause I'm obviously paying for by other means! :-) -- 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] Best alternate editor/IDE for someone who gets overwhelmed by complexity
As Matthew B wrote, but in general, I think you have hit the nail on the head — if you come from/are used to a world where the IDE governs your thinking. With Racket we try a different approach; we want the language to govern your thinking and we want the language to allow you to think directly in terms of problem issues/aspects/concepts. It also accommodates almost every style, including top-down. [*] So, let me recommend something in addition to Matthew’s suggestions. Write extremely small modules. I try to write modules that fit on one or two or at most three screens of code. I write functions/methods that are a dozen lines long. I understand that this doesn’t always work extremely well but in principle, Racket’s expressive power allows you to do so, especially for beginners. — Matthias [*] Remember that Pascal morphed in Modula, Oberon, and Modula 2 — all of which introduce a form of module because people learned that this was the best way to break up programs. > On Nov 26, 2016, at 10:54 AM, SRwrote: > > Hi, > > I've never been a great programmer although I've done a fair amount of > programming back in the days of C, Pascal, etc. I think racket is the right > language for me based on expressive power, etc. but I confess it currently > seems like about the worst language for me in terms of "can't see the forest > for the trees". I am hoping someone out there can recommend a strong editor > / IDE which makes it trivial to collapse blocks of code or otherwise make it > a lot easier to navigate through long racket programs. Something which would > allow me to look at a program in outline format and then expand/collapse the > outline when I need/don't need to see details. It's cool (really cool, in > fact) that racket comes with DrRacket - I think that really showcases how > extraordinary racket is. However, it's already apparent that, for me, I need > something to manage / hide the "visual clutter" of scheme with all its parens > and (for lack of a better word) mind-numbing presentation. Maybe, in time, > I'll get personally stronger but I won't get there at all at this rate. > > Pascal was probably my favorite language in terms of hiding details. It > encouraged an "outline" form of program development where I could could > create sub-procedures where I could ignore large blocks of code or even > remove them completely out of sight. C wasn't so great in this regard. > > I am determined to master racket and I am hoping it will be the last > programming language I ever really need to learn (because of its strong > "batteries included" orientation; respectable speed; wide range of > application; and on-going development history). > But I am having a miserable time "reading" it. Everything sticks out at the > same time for me and I am unable to really focus on top down thinking -- > which is how my mind works. My visual "recall" is very poor, which > contributes to my problem (I can't remember where things are/ how they are > coded if they are not right in front of me). > > I have been out of programming for a long, long time so I really have no idea > what the state of the art is in IDE and programming editors. I know there > probably is a great environment which does a solid job of supporting racket > development but - MOST OF ALL - makes it trivial to > collapse/expand/"disappear" the majority of program code so I don't have to > wade through stuff which doesn't concern me at the moment. Other strong IDE/ > programming editor features (e.g., super searching across packages and files) > would, of course, be great but for me I fear it mostly comes down to ability > to bundle related portions of the program together and make them collapse > down to a single line. > > An open/free sourced IDE which is available on Linux would be best, although > I could consider developing on Mac or (ugh) Windows. I am open to paying > money, but I would prefer to not be under a vendor's thumb. > > Maybe EMACS or VIM or even Atom could make me happy -- if I could find the > extensions to handle the collapse/expand and (ideally) strong ability to keep > the parens sorted out. > > Any suggestions are appreciated. I really am embarrassed to be asking this > sort of question but I really don't know how to go forward without some > guidance. > > Thanks for any suggestions. > > -- > 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. -- 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
Re: [racket-users] Best alternate editor/IDE for someone who gets overwhelmed by complexity
On Nov 26, 2016, at 7:54 AM, SRwrote: > I am hoping someone out there can recommend a strong editor / IDE which makes > it trivial to collapse blocks of code or otherwise make it a lot easier to > navigate through long racket programs FWIW, DrRacket does have a "Collapse S-expression" function (right-click in any expression). It also has a "Program Contour" overview that shows the whole program in miniature. -- 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] DrRacket Crashes on New MacBook Pro
Thanks. I believe the 32 bit version works, so you can use that as a workaround for now. Robby On Sat, Nov 26, 2016 at 11:34 AM, 'Scott Brown' via Racket Userswrote: > I recently bought a new MacBook Pro and installed Racket. Unfortunately, > DrRacket crashes immediately when I try to open it. It appears to be due an > issue with its interaction with the touch bar. > > Below is the problem report from the crash. > > -Scott > > > Process: DrRacket [16616] > Path: > /Applications/Developer/*/DrRacket.app/Contents/MacOS/DrRacket > Identifier:org.racket-lang.DrRacket > Version: 6.7 (6.7) > Code Type: X86-64 (Native) > Parent Process:??? [1] > Responsible: DrRacket [16616] > User ID: 501 > > Date/Time: 2016-11-26 11:34:26.714 -0600 > OS Version:Mac OS X 10.12.1 (16B2657) > Report Version:12 > Anonymous UUID:4F5A719F-C9D0-A567-DEA3-DA77E250A07E > > Sleep/Wake UUID: 707785BC-91BB-4BBD-8B8E-F83BC6B519E1 > > Time Awake Since Boot: 76000 seconds > Time Since Wake: 4000 seconds > > System Integrity Protection: enabled > > Crashed Thread:0 Dispatch queue: com.apple.main-thread > > Exception Type:EXC_BAD_ACCESS (SIGSEGV) > Exception Codes: KERN_INVALID_ADDRESS at 0x0008 > Exception Note:EXC_CORPSE_NOTIFY > > Termination Signal:Segmentation fault: 11 > Termination Reason:Namespace SIGNAL, Code 0xb > Terminating Process: exc handler [0] > > VM Regions Near 0x8: > --> > __TEXT 0001-00019000 [ 36K] r-x/rwx > SM=COW /Applications/Developer/*/DrRacket.app/Contents/MacOS/DrRacket > > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread > 0 libobjc.A.dylib 0x7fffac2ddf1c > class_conformsToProtocol + 152 > 1 libobjc.A.dylib 0x7fffac2dde71 -[NSObject > conformsToProtocol:] + 52 > 2 com.apple.AppKit0x7fff95b94513 addProviders + 135 > 3 com.apple.AppKit0x7fff95b9447a +[NSTouchBarFinder > _currentProviders] + 439 > 4 com.apple.AppKit0x7fff95b94d4e -[NSTouchBarFinder > _update] + 88 > 5 com.apple.AppKit0x7fff95b95155 > __36-[NSTouchBarFinder __setNeedsUpdate]_block_invoke + 41 > 6 com.apple.CoreFoundation0x7fff9797bec7 > __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 > 7 com.apple.CoreFoundation0x7fff9797be37 > __CFRunLoopDoObservers + 391 > 8 com.apple.CoreFoundation0x7fff9795cafa __CFRunLoopRun + > 906 > 9 com.apple.CoreFoundation0x7fff9795c514 > CFRunLoopRunSpecific + 420 > 10 com.apple.HIToolbox 0x7fff96eed2ac > RunCurrentEventLoopInMode + 240 > 11 com.apple.HIToolbox 0x7fff96eecfe9 > ReceiveNextEventCommon + 184 > 12 com.apple.HIToolbox 0x7fff96eecf16 > _BlockUntilNextEventMatchingListInModeWithFilter + 71 > 13 com.apple.AppKit0x7fff954ef6cd _DPSNextEvent + > 1093 > 14 com.apple.AppKit0x7fff95c66830 > -[NSApplication(NSEvent) > _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2730 > 15 Racket 0x00010039776c ffi_call_unix64 + > 76 > 16 Racket 0x00010039800a ffi_call + 922 > 17 Racket 0x00010038884d ffi_do_call + 2173 > 18 Racket 0x000100387fac > ffi_do_call_after_stack_check + 268 > 19 ??? 0x0001059dcbb6 0 + 4389194678 > 20 ??? 0x0001005c5c3b 0 + 4301020219 > 21 Racket 0x000100071f75 scheme_do_eval + > 13381 > 22 Racket 0x0001000729b5 > _scheme_apply_multi_from_native + 437 > 23 ??? 0x0001005b926b 0 + 4300968555 > 24 Racket 0x000100071f75 scheme_do_eval + > 13381 > 25 Racket 0x0001000a0fd2 apply_k + 210 > 26 Racket 0x0001000a05e7 > scheme_top_level_do_worker + 2039 > 27 Racket 0x0001003592d1 start_child + 1153 > 28 ??? 0x0001005c0b07 0 + 4300999431 > 29 Racket 0x000100359df7 make_subprocess + > 759 > 30 Racket 0x0001003595e1 > scheme_thread_w_details + 321 > 31 ??? 0x7fff5fbfa048 0 + 140734799781960 > > Thread 1: > 0 libsystem_kernel.dylib 0x7fffacceb41a mach_msg_trap + 10 > 1 libsystem_kernel.dylib 0x7fffaccea867 mach_msg + 55 > 2
[racket-users] DrRacket Crashes on New MacBook Pro
I recently bought a new MacBook Pro and installed Racket. Unfortunately, DrRacket crashes immediately when I try to open it. It appears to be due an issue with its interaction with the touch bar. Below is the problem report from the crash. -Scott Process: DrRacket [16616] Path: /Applications/Developer/*/DrRacket.app/Contents/MacOS/DrRacket Identifier:org.racket-lang.DrRacket Version: 6.7 (6.7) Code Type: X86-64 (Native) Parent Process:??? [1] Responsible: DrRacket [16616] User ID: 501 Date/Time: 2016-11-26 11:34:26.714 -0600 OS Version:Mac OS X 10.12.1 (16B2657) Report Version:12 Anonymous UUID:4F5A719F-C9D0-A567-DEA3-DA77E250A07E Sleep/Wake UUID: 707785BC-91BB-4BBD-8B8E-F83BC6B519E1 Time Awake Since Boot: 76000 seconds Time Since Wake: 4000 seconds System Integrity Protection: enabled Crashed Thread:0 Dispatch queue: com.apple.main-thread Exception Type:EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0008 Exception Note:EXC_CORPSE_NOTIFY Termination Signal:Segmentation fault: 11 Termination Reason:Namespace SIGNAL, Code 0xb Terminating Process: exc handler [0] VM Regions Near 0x8: --> __TEXT 0001-00019000 [ 36K] r-x/rwx SM=COW /Applications/Developer/*/DrRacket.app/Contents/MacOS/DrRacket Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x7fffac2ddf1c class_conformsToProtocol + 152 1 libobjc.A.dylib 0x7fffac2dde71 -[NSObject conformsToProtocol:] + 52 2 com.apple.AppKit0x7fff95b94513 addProviders + 135 3 com.apple.AppKit0x7fff95b9447a +[NSTouchBarFinder _currentProviders] + 439 4 com.apple.AppKit0x7fff95b94d4e -[NSTouchBarFinder _update] + 88 5 com.apple.AppKit0x7fff95b95155 __36-[NSTouchBarFinder __setNeedsUpdate]_block_invoke + 41 6 com.apple.CoreFoundation0x7fff9797bec7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 7 com.apple.CoreFoundation0x7fff9797be37 __CFRunLoopDoObservers + 391 8 com.apple.CoreFoundation0x7fff9795cafa __CFRunLoopRun + 906 9 com.apple.CoreFoundation0x7fff9795c514 CFRunLoopRunSpecific + 420 10 com.apple.HIToolbox 0x7fff96eed2ac RunCurrentEventLoopInMode + 240 11 com.apple.HIToolbox 0x7fff96eecfe9 ReceiveNextEventCommon + 184 12 com.apple.HIToolbox 0x7fff96eecf16 _BlockUntilNextEventMatchingListInModeWithFilter + 71 13 com.apple.AppKit0x7fff954ef6cd _DPSNextEvent + 1093 14 com.apple.AppKit0x7fff95c66830 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2730 15 Racket 0x00010039776c ffi_call_unix64 + 76 16 Racket 0x00010039800a ffi_call + 922 17 Racket 0x00010038884d ffi_do_call + 2173 18 Racket 0x000100387fac ffi_do_call_after_stack_check + 268 19 ??? 0x0001059dcbb6 0 + 4389194678 20 ??? 0x0001005c5c3b 0 + 4301020219 21 Racket 0x000100071f75 scheme_do_eval + 13381 22 Racket 0x0001000729b5 _scheme_apply_multi_from_native + 437 23 ??? 0x0001005b926b 0 + 4300968555 24 Racket 0x000100071f75 scheme_do_eval + 13381 25 Racket 0x0001000a0fd2 apply_k + 210 26 Racket 0x0001000a05e7 scheme_top_level_do_worker + 2039 27 Racket 0x0001003592d1 start_child + 1153 28 ??? 0x0001005c0b07 0 + 4300999431 29 Racket 0x000100359df7 make_subprocess + 759 30 Racket 0x0001003595e1 scheme_thread_w_details + 321 31 ??? 0x7fff5fbfa048 0 + 140734799781960 Thread 1: 0 libsystem_kernel.dylib 0x7fffacceb41a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x7fffaccea867 mach_msg + 55 2 Racket 0x0001003990a6 exception_thread + 134 3 libsystem_pthread.dylib 0x7fffacddbaab _pthread_body + 180 4 libsystem_pthread.dylib 0x7fffacddb9f7 _pthread_start + 286 5 libsystem_pthread.dylib 0x7fffacddb221 thread_start + 13 Thread 2: 0 libsystem_kernel.dylib 0x7fffaccf2c8a __psynch_cvwait + 10 1
[racket-users] Best alternate editor/IDE for someone who gets overwhelmed by complexity
Hi, I've never been a great programmer although I've done a fair amount of programming back in the days of C, Pascal, etc. I think racket is the right language for me based on expressive power, etc. but I confess it currently seems like about the worst language for me in terms of "can't see the forest for the trees". I am hoping someone out there can recommend a strong editor / IDE which makes it trivial to collapse blocks of code or otherwise make it a lot easier to navigate through long racket programs. Something which would allow me to look at a program in outline format and then expand/collapse the outline when I need/don't need to see details. It's cool (really cool, in fact) that racket comes with DrRacket - I think that really showcases how extraordinary racket is. However, it's already apparent that, for me, I need something to manage / hide the "visual clutter" of scheme with all its parens and (for lack of a better word) mind-numbing presentation. Maybe, in time, I'll get personally stronger but I won't get there at all at this rate. Pascal was probably my favorite language in terms of hiding details. It encouraged an "outline" form of program development where I could could create sub-procedures where I could ignore large blocks of code or even remove them completely out of sight. C wasn't so great in this regard. I am determined to master racket and I am hoping it will be the last programming language I ever really need to learn (because of its strong "batteries included" orientation; respectable speed; wide range of application; and on-going development history). But I am having a miserable time "reading" it. Everything sticks out at the same time for me and I am unable to really focus on top down thinking -- which is how my mind works. My visual "recall" is very poor, which contributes to my problem (I can't remember where things are/ how they are coded if they are not right in front of me). I have been out of programming for a long, long time so I really have no idea what the state of the art is in IDE and programming editors. I know there probably is a great environment which does a solid job of supporting racket development but - MOST OF ALL - makes it trivial to collapse/expand/"disappear" the majority of program code so I don't have to wade through stuff which doesn't concern me at the moment. Other strong IDE/ programming editor features (e.g., super searching across packages and files) would, of course, be great but for me I fear it mostly comes down to ability to bundle related portions of the program together and make them collapse down to a single line. An open/free sourced IDE which is available on Linux would be best, although I could consider developing on Mac or (ugh) Windows. I am open to paying money, but I would prefer to not be under a vendor's thumb. Maybe EMACS or VIM or even Atom could make me happy -- if I could find the extensions to handle the collapse/expand and (ideally) strong ability to keep the parens sorted out. Any suggestions are appreciated. I really am embarrassed to be asking this sort of question but I really don't know how to go forward without some guidance. Thanks for any suggestions. -- 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] eval:check and floating-point precision
On Sat, Nov 26, 2016 at 11:37 AM, luis.osa.gdcwrote: > Hi, everyone! > ``` > (check-= (t-test bacteria-a bacteria-b) 13.0 0.1) > ``` > > In short: is there a way to specify tolerance in `eval:check`? Perhaps, instead of checking directly the result of t-test you can check (good-enough (t-test ...) expected-value) ? Where good-enough is something you define to be appropriate for your needs. -- 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] css and js files when using scribble
Thanks for the clear answer. I'll try raco pkg install ..., but command line stuff is troublesome on windows. But I'll try. Jos _ From: Matthew Butterick [mailto:m...@mbtype.com] Sent: viernes, 25 de noviembre de 2016 23:03 To: Jos Koot Cc: Racket Users Subject: Re: [racket-users] css and js files when using scribble On Nov 25, 2016, at 12:54 PM, Jos Kootwrote: Every time I click Scribble HTML in DrRacket for a scribble/manual module in a separate directory I find that a number of css files and two js files are produced in the same directory (Windows 7) Are these files always the same? If so can't we put them in Appdata.Roaming, in order to avoid multiple copies? Or may be they can be pre-included in the Racket tree? I expect there is a good reason for generating a new set of css and js files for every (HTML) file produced by scribble, but I have not the slightest idea why. IIUC, when you click "Scribble HTML", Scribble makes a self-contained render, which necessarily includes the CSS and JavaScript files that the HTML files depend on. (Corollary: this render has no dependencies on local resources, so it can be moved anywhere, e.g., a remote web server.) But when you install a package normally (e.g., via `raco pkg install ...`), Racket can rely on the shared copy of those files used by all documentation, so they are not duplicated. -- 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] How to test that a file is syntactically correct, but don't run it
Some weeks ago, I just had the exact same problem while developing a "server.rkt" module with Vim. I use the Syntactic plugin to check syntax, and this plugin in turn uses the `racket` executable to find syntax problems. My solution was to add the args "--load" when executing the module with `racket`, e.g. this command checks the syntax but does not run the module: $ racket --load server.rkt If using Vim and Syntastic, add this line to your .vimrc: let g:syntastic_racket_racket_args="--load" -- 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] eval:check and floating-point precision
Hi, everyone! I am writing a simple statistical package for Racket, and I would like to have tests within my Scribble documentation (as well as Rackunit tests in the implementation modules). For the Scribble tests, I am using `eval:check`. But I have noticed that the tests do not pass unless the written result is exactly the same floating-point number coming out of the Racket procedure. In other words, you cannot set a tolerance for the result, as you can do with Rackunit's `check-=`. As an example, suppose I have a procedure `t-test`. The checked example in Scribble would have to be like this: ``` @examples[ #:eval helper-eval @eval:check[ (t-test bacteria-a bacteria-b) 13.010764773832472 ] ] ``` while the Rackunit test can be much less precise ``` (check-= (t-test bacteria-a bacteria-b) 13.0 0.1) ``` I am worried that this is not portable: if my package is installed in another machine, and the floating-point results are different there, would the examples fail to pass, even though nothing is incorrect? Also, the number in `eval:check` has to have the same number of significant digits: it cannot have the "right sequence" but be truncated at an earlier point than the result coming out of Racket. This forces me to do something I do not like: to use the procedure under test in order to see the result, and then copy that into the test's result. I would prefer to use a different mechanism (e.g. Julia or Python or hand calculations) to produce results beforehand, but in most cases I cannot because they provide less significant digits than Racket. (Which is otherwise a cool thing for Racket :) ). In short: is there a way to specify tolerance in `eval:check`? Thanks for any help! Luis -- 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] How to test that a file is syntactically correct, but don't run it
raco read or raco expand may be the closest to doing this without doing much else. https://docs.racket-lang.org/raco/read.html Is there some way to e.g. hook some of DrRackets syntax checker up to a raco check-syntax? That would be convenient in the terminal. -- Sent from my phoneamajig > On Nov 26, 2016, at 01:28, David Storrswrote: > > As part of my pre-checkin test suite I'd like to be able to check that all > files are syntactically correct, but I don't want to actually execute them > because, e.g. executing 'server.rkt' would start the server and I don't want > that. Is there a way to do this? Nothing I see under 'raco help' or the > racket docs suggests a solution. > -- > 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. -- 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.