Elsa icon indicating copy to clipboard operation
Elsa copied to clipboard

Annotate all the built-in C functions

Open Fuco1 opened this issue 5 years ago • 7 comments

See https://github.com/Fuco1/Elsa/blob/master/dev/builtin.txt

  • [ ] w32proc.c
  • [ ] data.c
  • [x] bytecode.c
  • [ ] w32fns.c
  • [ ] coding.c
  • [x] callproc.c
  • [ ] kqueue.c
  • [x] print.c
  • [x] xmenu.c
  • [ ] inotify.c
  • [ ] indent.c
  • [ ] minibuf.c
  • [ ] decompress.c
  • [ ] undo.c
  • [ ] casefiddle.c
  • [ ] eval.c
  • [ ] keyboard.c
  • [ ] xwidget.c
  • [ ] w32menu.c
  • [ ] fringe.c
  • [ ] buffer.c
  • [ ] marker.c
  • [ ] xdisp.c
  • [ ] composite.c
  • [ ] floatfns.c
  • [ ] callint.c
  • [ ] w32notify.c
  • [x] alloc.c
  • [x] cmds.c
  • [ ] atimer.c
  • [ ] xfaces.c
  • [ ] dispnew.c
  • [ ] chartab.c
  • [ ] w16select.c
  • [ ] cygw32.c
  • [ ] insdel.c
  • [ ] ccl.c
  • [ ] xml.c
  • [x] process.c
  • [ ] emacs.c
  • [ ] xfns.c
  • [ ] dbusbind.c
  • [ ] profiler.c
  • [ ] lread.c
  • [ ] fns.c
  • [ ] font.c
  • [ ] window.c
  • [ ] w32font.c
  • [ ] term.c
  • [ ] image.c
  • [ ] filelock.c
  • [ ] charset.c
  • [ ] dosfns.c
  • [ ] doc.c
  • [ ] w32select.c
  • [ ] sound.c
  • [ ] xsettings.c
  • [ ] search.c
  • [ ] casetab.c
  • [ ] category.c
  • [ ] fontset.c
  • [ ] textprop.c
  • [x] dired.c
  • [ ] editfns.c
  • [ ] keymap.c
  • [ ] gfilenotify.c
  • [ ] terminal.c
  • [ ] nsfns.m
  • [ ] syntax.c
  • [ ] fileio.c
  • [ ] frame.c
  • [ ] xsmfns.c
  • [ ] macros.c
  • [ ] gnutls.c
  • [ ] emacs-module.c
  • [ ] w32console.c
  • [ ] nsselect.m
  • [ ] menu.c
  • [ ] msdos.c
  • [ ] nsmenu.m
  • [ ] character.c
  • [ ] xselect.c

Fuco1 avatar Aug 06 '18 08:08 Fuco1

Once we finish #74 I'm going to need some serious volunteer work here :D

Fuco1 avatar Sep 13 '18 15:09 Fuco1

Do you have any instruction (a five-year-old girl could understand) for someone who want to contribute?

randomwangran avatar Jan 08 '19 14:01 randomwangran

Hey @randomwangran!

  1. Go to the file builtin.txt linked in the OP
  2. Pick a file you would like to contribute. They are on lines prefixed by File:
  3. Let's say you chose minibuf.c. It contains 22 functions (as listed in the list file). Open elsa-typed-builtin.el and add a section for minibuf.c (copy all the lines with functions and place them in a comment).
  4. Start annotating the functions. That is done with the put function, you can see many examples in the file already. Usually you will need to look at C-h f to see the documentation of what the function takes in and returns and create a type accordingly. Some tips on how the types are created you can find in README.md
  5. Create a pull request with the changes.

If you have some more questions feel free to ask!

You can also pick any commented lines which are already present in elsa-typed-builtin.el and fix the types there instead of starting work on a new file.

Fuco1 avatar Jan 08 '19 16:01 Fuco1

Thank you, Fuco1. Very clear explanation! I can almost fully understand 1,2,3, and 5. I will need more time to understand what 4 is asking. It needs time. Hopefully, it's not so urgent. I would like to start with editfns.c file. As you can see, I am a newbie in elisp and I am not a professional coder. It might take considerably long time before I finish it, but I will try my best to contribute my effort to this beautiful princess in Emacs world.

randomwangran avatar Jan 17 '19 15:01 randomwangran

@randomwangran If you are new then start the pull request as soon as possible even if there's just one line so we can help out and comment on anything unclear. That way you can slowly progress on your own pace and also get the feedback in one place. We're not rushing anywhere so no problem.

As for line 4, you can look at the examples already existing. It currently uses a little bit un-lispy syntax so if something is unclear please ask, we love questions!

Fuco1 avatar Jan 17 '19 19:01 Fuco1

Just let you know, I start to do my work. Slowly but surely.

@Fuco1 Thanks for your aditional info. It will help me to further understand what should I do.

Today, I made my commitment on reading README.MD file, i.e.,

Here are general guidelines on how the types are constructed. The exactly info is: Cons types are specified by prefixing wrapping the car and cdr types with a Cons constructor, so Cons Int Int is a type where the car is an int and cdr is also an int, for example (1 . 3).

There are a total number of 8 items, I am working on 3rd.

I had some questions on my journey file. Not sure, it is necessary to ask you immediately, but I put the link here, in case of you have some free time.

I will continue reading the README.MD file, then work on the PULL request file to further study. Maybe I would figure it out somedays later.

randomwangran avatar Jan 18 '19 04:01 randomwangran

You can also read this pull request for documentation on the type system and how it works. It uses the new syntax and we will switch to that later. And it looks more like lisp. So you might even just go ahead with that already.

The downside is that it currently isn't testable. Either way, it might be a helpful overview.

Also the way we annotate functions with comments will change (but it is still good to understand that as well because the change will only be stylistic), so it's safer to add annotations here.

Fuco1 avatar Jan 18 '19 08:01 Fuco1