Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> it seems crazy to me that Go's GC can Just Work with a VM you're writing in Go itself.

Far from it, it is more natural to do that than anything else.

Simplified example:

  type Array struct {
    items *any[]
  }

  type Object struct {
    fields map[string]*any
  }
These are the JVM values, and when the references to them disappear, the JVM values they reference can be GC'd as well.


your example is not valid Go code:

syntax error: unexpected ], expected type argument list

and its also just poor style in general. "any" is already a pointer, so you would rarely design a pointer to any. example:

https://godocs.io/encoding/json#Marshal


It’s just pseudo code, relax. You’re not a compiler. You know what they meant.


[flagged]


This comment (and the subsequent follow-up reply) violates the HN comment guidelines:

- Be kind. Don't be snarky. Converse curiously; don't cross-examine. Edit out swipes.

- When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."


Lighten up. Someone answered a question in a concise manner with some pseudo code, probably in a language they haven’t context switched to in a couple weeks. The pedantry you’re displaying doesn’t help the conversation. Do you have substantive insight to provide about how the go GC works with Java’s different JVM improvements?

If not, you can just rate the post up or down


What of it, though? I noticed, but didn't think much of it because pseudocode doesn't need to be valid and usually isn't. What is the problem with these syntax errors that you are trying to address by calling attention to them?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: