Comments (16)
Can you help me understand an example use case for this? I've never really appreciated how/when/why this feature is desirable in DrRacket. In addition to helping me understand, I could probably also use you specific example for a test case.
from racket-mode.
This crashed my system. I used wrong argument lst2
instead of lst2-to-cdr
.
#lang racket
;Cartesian product
(define product
(λ (lst1 lst2)
(if (null? lst2)
(quote ())
(product-aux lst1 lst2 lst2))))
(define product-aux
(λ (lst1 lst2 lst2-to-cdr)
(cond [(null? lst1) (quote ())]
[(null? lst2-to-cdr) (product-aux (cdr lst1) lst2 lst2)]
[else (cons (list (car lst1) (car lst2-to-cdr))
(product-aux lst1 lst2 (cdr lst2 #;-to-cdr )))]
)))
(module+ test
(require rackunit rackunit/text-ui)
(define tests
(test-suite "TestSuite"
(check-equal? (product '(a b c) '(x y))
'((a x) (a y) (b x) (b y) (c x) (c y)))
))
(run-tests tests))
from racket-mode.
Thank you for the example!
This crashed my system
To make sure I understand what you mean by "system" -- do you mean that Emacs crashed, or your entire computer/OS?
I did a few experiments using custodian-limit-memory
. In some cases I got an explicit "out of memory" error (good) but in other cases it just seemed to keep running silently (?).
I'll need to spend more than 5 minutes to understand how it works and what's expected; and perhaps ask some questions on the Racket mailing list.
from racket-mode.
Entire OS was not responding, HDD was active constantly. Only cold reset helped.
Windows 7x64, GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-18 on MARVIN
from racket-mode.
Ouch. It would be great if you could report that as a bug to the Racket team, here, too?
At the same time, I spent some time looking into adding support for racket-mode to support a memory limit like DrRacket. Although I don't have something I think is quite ready to push as a commit, I hope to soon.
from racket-mode.
Tried the code with a page file disabled. Now I can terminate the process by agreeing with dialog window:
Microsoft Visual C++ Runtime Library
-------------------------------------------------
Runtime error!
Program: C:\...\Racket.exe
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
[OK]
cmd prints Racket virtual machine has run out of memory; aborting
racket-mode REPL: Process Racket REPL exited abnormally with code 3
(code 29
once)
- This dialog displays normally with Windows Aero Mode disabled. With Aero there is only an icon on a task bar.
- With the page file I'd waited about 3 minutes when the monitor went black, hdd was kept busy.
- It takes about half a minute to reach the memory limit (8Gb, without page file). So, is it a bug or not, but for the comfort work the memory limit is vital.
- Should I really report a bug to Racket (after my research) ?
from racket-mode.
Your code isn't explicitly disabling breaks, so, you should be able to break it. If that's not possible in some scenarios on Windows, it should be considered a bug in Racket.
The Racket devs are super friendly about bug reports, especially with the level of detail you have here. So, even if I'm mistaken and they don't consider it a bug (?), I think they'd welcome the report.
Having said all that, I still plan to add the memory limit to racket-mode. I worked on it yesterday. It worked in the sense that the program stopped allocating more memory (good), and I could C-c break it on OS X (good) -- but it didn't stop automatically and give an explanation like DrRacket does (bad). So I need to figure that out.
from racket-mode.
OK, I figured out the missing piece, how to handle custodian-limit-memory
s automatic shutdown.
For now I only pushed this to a topic branch, limit-memory. @JohnGurin have you installed racket-mode from MELPA, or from source here? If the latter, could you please try the limit-memory branch for me on Windows?
I ask because I'm away from home for several weeks, and home is where I have a Windows laptop with which to test. I'm 90% sure this will work correctly for you on Windows, but I'd love to hear you confirm it if possible before I merge to master.
from racket-mode.
F5 / Ctrl+F5 doesn't work.
Racket REPL output: ; "c:/Users/John/Documents/racket/myfile.rkt" not found
Cloned master
and limit-memory
branches. Tried them both in turn (by switching folders). master
works.
from racket-mode.
That might happen if Emacs has "stale", master
-branch versions of some Elisp functions like racket-run
, and they don't match the Racket code. I had to change the ,run
and ,top
commands to take an optional memory-limit parameter.
Could you please try:
- Quit Emacs completely.
- Switch to using the
limit-memory
branch. - Start Emacs.
Please let me know if that works?
(If it doesn't, then either I need to wait a few weeks until I have access to my Windows laptop, or, get access to Windows some other way like buying and installing under Virtual Box.)
from racket-mode.
@JohnGurin Never mind -- I got access to Windows and I can repro the problem you're seeing. Working on a fix.
from racket-mode.
This commit works for me on Windows: ca68ab5
from racket-mode.
This commit fixed the issue.
Oops! Tried the path with non-Latin characters and spaces. Non-Latin characters are no trouble.
Spaces causes this:
Racket REPL output:
Welcome to Racket v6.1.1.
≺≻ ; UNKNOWN::0: read: expected a closing '"'
; Context:
; c:\Users\John\AppData\Roaming\.emacs.d\site-lisp\racket-mode\cmds.rkt:30:2
≺≻
master
handles spaces.
from racket-mode.
Good catch! I just pushed bac69e1 which works for me with filenames containing spaces, including on Windows.
Please let me know if you have any other problems or issues, using that commit? Otherwise I'd like to merge to master.
from racket-mode.
Seems to work without flaws
from racket-mode.
Great. Likewise on my end. I'll merge to master. MELPA should pick up that change soon thereafter.
Thank you for your help testing this.
from racket-mode.
Related Issues (20)
- Significant slowdowns with latest `racket-mode` version HOT 14
- `racket--hash-lang-lookup-pair` can be confused by wrong classification HOT 6
- `racket-hash-lang-mode` should turn off `electric-pair-open-newline-between-pairs`
- Wrapping a region with pairs should not move to end of region HOT 3
- Emacs 30 update `shr-heading`, which breaks `racket-describe` HOT 4
- racket-repl-mode ansi escape code coloring HOT 6
- pretty-print not happening despite `racket-pretty-print` set to `t`? HOT 5
- `racket-repl-goto-error-location` chokes every *even* number of error locations HOT 2
- Using racket-hash-lang-mode with org-mode source blocks HOT 18
- `narrow-to-defun` doesn't work properly HOT 2
- `beginning-of-defun` doesn't work properly when narrowed HOT 6
- FYI: Scribble HTML change HOT 2
- `racket-xp-rename` could use future history
- support macro hiding in racket-stepper mode? HOT 10
- Racket mode is just not working. Can someone please help me? HOT 4
- Identifiers with @ in racket-xp-mode HOT 5
- Regexp-based highlighting of lines HOT 2
- racket-tests/expand-expression passes with racket 8.10 on debian HOT 1
- Length of popup error HOT 2
- Out of range error in narrowed buffer during redisplay using `racket-xp-mode` HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from racket-mode.