Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
andolanra
on May 1, 2015
|
parent
|
context
|
favorite
| on:
Porting a NES Emulator from Go to Nim
You can have manual control over memory if you want, though. This worked the last time I looked at the language, at least:
foo = cast[ptr Foo](alloc(sizeof(Foo))) # do stuff with foo dealloc(foo)
EDIT: Here's the documentation on the site itself. Most things are 'traced' by the GC, but by using
alloc
and
dealloc
you can work with 'untraced' (i.e. manually allocated) memory:
http://nim-lang.org/0.11.0/manual.html#types-reference-and-p...
pcwalton
on May 1, 2015
[–]
Go has unsafe.Pointer too.
Consider applying for YC's Summer 2025 batch! Applications are open till May 13
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: