Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.misc > #11500
| From | BGB <cr88192@gmail.com> |
|---|---|
| Newsgroups | comp.lang.misc |
| Subject | Re: What’s Your Least Favourite Programming Language? |
| Date | 2025-11-03 14:55 -0600 |
| Organization | A noiseless patient Spider |
| Message-ID | <10eb4sa$34rab$2@dont-email.me> (permalink) |
| References | <10e1m38$8ukd$1@dont-email.me> <20251031081742.00003c76@gmail.com> <10eb1tv$34rab$1@dont-email.me> <10eb3c0$34i0o$6@dont-email.me> |
On 11/3/2025 2:29 PM, Lawrence D’Oliveiro wrote: > On Mon, 3 Nov 2025 14:05:12 -0600, BGB wrote: > >> Also, absent additional analysis steps or similar, and thus code >> complexity, full lexical scoping is prone to rapidly leak memory. > > You mean, you need to put call frames on the heap, not the stack? And > that will expose any lack of robustness in your memory-management > scheme? > Yes. Minimal memory management: Don't bother with GC; Minimal handling of lexical closures: Just put the frames of the heap, capture them if a closure is created, don't bother with case of closure not being created. But, this is a bad scenario, as it results in an explosively bad memory leak... > By the way, Python is clever enough to only put referenced outer-level > variables within the closure. > Yes, but: Detecting which variables are captured, or whether or not there is capture or non-capture, is the "additional analysis steps" thing... Likewise, the cheaper option is using a per-frame flag for capture-vs-non-capture (frame is freed if the "frame was captured" flag is not set). Still though, this is more code complexity than not using lexical scoping in the first place. Like, dynamic scoping doesn't need frames that may or may not be captured, can just put all of the variables onto a stack and push/pop this stack position per-frame. >> This is a non-issue with dynamic scoping, even if, potentially, >> using dynamic scoping as the default is itself a foot gun (in terms >> of semantics). > > This sounds like a “I could implement it much more efficiently if I > didn’t have to do it correctly” kind of argument ... It is cheap and simple... But, one thing it is not, is semantically equivalent to lexical scoping. Some of my past languages had both lexical and dynamic scoping (with lexical as the default). This can make more sense. But, as noted, the goal in the case of this interpreter was to use less code, and probably would have needed to spend maybe an additional 300 lines of code or similar to have added support for lexical scoping (that wouldn't just immediately leak all the RAM). ...
Back to comp.lang.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What’s Your Least Favourite Programming Language? Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-10-31 06:48 +0000
Re: What’s Your Least Favourite Programming Language? David Brown <david.brown@hesbynett.no> - 2025-10-31 13:28 +0100
Re: What’s Your Least Favourite Programming Language? John Ames <commodorejohn@gmail.com> - 2025-10-31 08:17 -0700
Re: What’s Your Least Favourite Programming Language? bart <bc@freeuk.com> - 2025-10-31 22:47 +0000
Re: What’s Your Least Favourite Programming Language? Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-11-01 06:26 +0000
Re: What’s Your Least Favourite Programming Language? BGB <cr88192@gmail.com> - 2025-11-03 14:05 -0600
Re: What’s Your Least Favourite Programming Language? Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-11-03 20:29 +0000
Re: What’s Your Least Favourite Programming Language? BGB <cr88192@gmail.com> - 2025-11-03 14:55 -0600
Re: What’s Your Least Favourite Programming Language? Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-11-03 23:10 +0000
Re: What’s Your Least Favourite Programming Language? BGB <cr88192@gmail.com> - 2025-11-04 12:02 -0600
Re: What’s Your Least Favourite Programming Language? Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-11-04 20:32 +0000
Re: What’s Your Least Favourite Programming Language? John Ames <commodorejohn@gmail.com> - 2025-11-03 15:56 -0800
Re: What’s Your Least Favourite Programming Language? Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-27 21:11 -0300
Re: What’s Your Least Favourite Programming Language? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 04:42 +0000
Write Once, Run Anywhere (was Re: What’s Your Least Favourite Programming Language?) Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-28 16:43 -0300
Re: What’s Your Least Favourite Programming Language? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 22:37 +0000
the history of Java in Android (was Re: What’s Your Least Favourite Programming Language?) Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-28 20:27 -0300
Re: the history of Java in Android (was Re: What’s Your Least Favourite Programming Language?) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-29 01:30 +0000
Re: the history of Java in Android (was Re: What’s Your Least Favourite Programming Language?) Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-29 15:24 -0300
Re: the history of Java in Android (was Re: What’s Your Least Favourite Programming Language?) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-29 21:57 +0000
Python deliberately breaking backward compatibility (was Re: What’s Your Least Favourite Programming Language?) Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-28 21:03 -0300
Re: Python deliberately breaking backward compatibility (was Re: What’s Your Least Favourite Programming Language?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-28 18:10 -0700
[meta] Date-formats in postings (was Re: Python deliberately breaking backward compatibility (was Re: What’s Your Least Favourite Programming Language?)) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-29 06:39 +0200
Re: What’s Your Least Favourite Programming Language? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-29 01:42 +0000
Re: What’s Your Least Favourite Programming Language? John Ames <commodorejohn@gmail.com> - 2026-08-28 09:59 -0700
Re: What’s Your Least Favourite Programming Language? Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-27 20:09 -0300
csiph-web