melange-re / melange-re.github.io

Documentation site for Melange
https://melange.re
25 stars 6 forks source link

Split 'communicate with javascript' page into multiple pages #198

Open feihong opened 5 days ago

feihong commented 5 days ago

https://melange.re/unstable/communicate-with-javascript.html has gotten very long. It can give a first-time reader the mistaken impression that you need to read a novella in order to understand JavaScript FFI. Let's move it into its own sidebar section (on the same level as Learn, Reference, Try, etc) and split it into multiple pages:

  1. Overview: this would be a new page that summarizes what will be covered in this section. Another idea is that it could be a Getting started page that includes a small example which gives you a taste of how FFI works.
  2. Language concepts
  3. Data types and runtime representation
  4. List of attributes and extension nodes
  5. Bind to JavaScript objects
  6. Bind to JavaScript functions or values
  7. Generate getters, setters, and constructors
  8. Bindings cookbook

There are a number of smaller sections that are sprinkled around the current page and I haven't quite figured out where they should go yet. They could go in their own pages, but I'm not sure it makes sense.

davesnx commented 5 days ago

IMO:

I also wonder if:

feihong commented 4 days ago

OK, how about this:

  1. Overview: this would be a new page that summarizes what will be covered in this whole section. Another idea is that it could be a Getting started page that includes a small example which gives you a taste of how FFI works.
  2. Language concepts
  3. Data types and runtime representation
    • Non-shared data types, but expanded a bit (I notice it lacks some detail)
  4. List of attributes and extension nodes Melange attributes and extension nodes
    • All attributes (table)
    • All extension nodes (table)
    • Generate raw JavaScript
    • Debugger
    • Detect global values (feels like this should be renamed though)
    • Inlining constant values
  5. Bind to JavaScript objects
  6. Bind to JavaScript values and functions
    • Advice for making more type-safe interfaces
  7. Generate getters, setters, and constructors
  8. Use Melange code from JavaScript (will be a small page but not sure what to put it under)
  9. Bindings cookbook