Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document what doc comments/docstrings are good for #20

Open
vks opened this issue Jul 8, 2016 · 7 comments
Open

Document what doc comments/docstrings are good for #20

vks opened this issue Jul 8, 2016 · 7 comments

Comments

@vks
Copy link
Contributor

vks commented Jul 8, 2016

The documentation tells you how to create doc comments, but it is not clear what they are good for. Maybe give a hint at how to use them?

(use code documentation)
(print (documentation ...))

It might make sense to have a function help that prints the documentation, like in Python. It would not be terribly useful at the moment, because it seems that the built-in functions and operators don't have docstrings.

@murarth
Copy link
Owner

murarth commented Jul 8, 2016

A help function is a good idea, but I'm not sure where it would go. I don't want to make it a built-in (i.e. Rust-implemented) function. The best option, I think, is to take a page from Python's book and have the Ketos REPL (and only the REPL) implicitly load some module, containing the help function. Unfortunately, an absolute location of libraries has not been established. I'm not sure if Cargo is equipped to install data files.

Documentation for built-in functions is also a good idea. One of those things I meant to get done at some point.

@murarth
Copy link
Owner

murarth commented Jul 8, 2016

Also, I was kind of thinking of looking into whether rustdoc could accept a plugin or something to generate Rust-esque documentation from Ketos code. I'm not sure how plausible that idea is. This would be in addition to a help function for quick doc access in the REPL.

@vks
Copy link
Contributor Author

vks commented Jul 8, 2016

You could put the modules into the ketos binary, using some build.rs magic. If you only store the bytecode and possibly compress it, it should not bloat the binary too much.

I think loading some modules by default in interactive mode is a great idea. list could be a good candidate for that as well.

@murarth
Copy link
Owner

murarth commented Jul 9, 2016

I don't like the idea of building module files into the binary. It's a weird and surprising thing for a language interpreter to do.

Perhaps the best solution for now is to define your own help function in your RC file (another feature lacking in documentation -- oops).

@vks
Copy link
Contributor Author

vks commented Jul 9, 2016

What about a KETOSPATH environment variable? Like Python is having.

@murarth
Copy link
Owner

murarth commented Jul 9, 2016

That is implemented already. It's KETOS_PATH. https://github.com/murarth/ketos/blob/master/docs/README.md#environment-variables

@murarth
Copy link
Owner

murarth commented Jul 9, 2016

As a start, I've pushed a commit that adds docstrings to system functions. So, there's that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants