Feral-Lang/Feral

Work on Book/Documentation

Electrux opened this issue · 7 comments

The following things are yet to be implemented in the Feral Book.

  • Implement more chapters
    • 7 - Loops
    • 8 - "Member" Functions
      • For
      • While
      • Foreach
    • 9 - "Member" Functions
    • 10 - Modules/Imports
    • 11 - Scopes and Variable Assignment vs Copy
    • 12 - Standard Library
      • 1 - IO
      • 2 - Lang
      • 3 - Strings
      • 4 - Vectors
      • 5 - Maps
      • 6 - FS
      • 7 - OS
      • 8 - Runtime
      • 9 - Ptr
      • 10 - Sys
      • 11 - Builder
  • Review existing chapters
  • Implement highlighting for Feral code blocks (Highlight.js)

Is there a way to get a list of the available types and functions available is a module? If so I could give a hand for the documentation

There isn't an explicit method for that, but, you can see the available functions in a module by taking a look at the src->add_nativefn, vm.add_typefn, and vm.gadd calls in the INIT_MODULE block of each module.
add_nativefn is simple functions (eg. io.println),
add_typefn is for type bound (member) functions,
gadd is for functions that are not attached to the source file and can be globally called just by the function name (e. import)

You can find the core module files (C++) in library/ directory. The standard library module files are in src/ directory of Feral-Std repository.

Also, some modules have some functions in their .fer files as well (eg. vector standard library module), which you can find in the include/ directory.

Hope that is legible. Please be sure to ask if there is any doubt or question.
And, thanks a lot ❤️

Ok thanks, that was I was mostly looking at. Do you intend the std part of the book to be a "how to" or more an API doc? Because want I would really want right now is more an API doc but I don't know if it should belong to the book or not.

Oh I have been planning to make it more in the style of API doc with, say, an example for the relevant functions. That way, it is concise, as well as can be easily understood by anyone who reads it.
If required, the API doc could be separated later on from the book.
What do you think?

Ok great. I'll starting listing everything currently present when I get a couple of minutes

Sure,
Thanks a lot! 😁

I started to work on it and the draft for the PR is here Feral-Lang/Book#1