Skip to content

Conversation

@LaszloLango
Copy link
Contributor

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com

@LaszloLango LaszloLango added development Feature implementation documentation Related to documentation labels Sep 1, 2016

## I/O

These should be the only I/O functions jerry calls. All calls to `printf`, `vfprintf`, and `putchar` should be rewritten to one of these, depending on what jerry wants to print.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the only functions jerry calls.
The rest can be deleted.

@zherczeg
Copy link
Member

zherczeg commented Sep 1, 2016

LGTM


## Termination

It is questionable whether a library should be able to terminate an application. However, as of now, we only have the concept of completion code around `jerry_parse` and `jerry_run`. Most of the other API functions have no way of signaling an error. So, we keep the termination approach with this port function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still have the concept of completion code around jerry_parse and jerry_run?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. AFAIK, "out of memory" errors can happen in jerry_create_... calls. @zherczeg ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, anything that allocates memory (property setting, etc.).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, completion code is an old concept, which has been removed, AFAIK. Those functions return jerry_value_t nowadays. So that seems definitely like an outdated sentence.

@LaszloLango LaszloLango added this to the Release 1.0 milestone Sep 1, 2016

This header containt the decleration of port specific helper functions for termination and I/O.

```C
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use consistent annotation of example language throughout the document. Either capital-C or small-c.

@LaszloLango LaszloLango mentioned this pull request Sep 1, 2016
15 tasks

# How to port JerryScript

This section describes the default port implementation which was created for Unix based systems.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that we should copy the default implementation verbatim here. From previous experiences, it seems that port creators often get confused by the default port-specific public helper methods (e.g., whether to abort or exit on failure). So, I think we should provide a simplified version here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind to simplify the documentation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd vote for providing a simpler example then. We just have to make sure that the example code works, of course...

@LaszloLango
Copy link
Contributor Author

@akosthekiss, @zherczeg: I've updated the PR. Please check.


## Termination

It is questionable whether a library should be able to terminate an application. Some of the API functions may signal an error (ex.: cannot allocate memory). So, we keep the termination approach with this port function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some of the API functions can signal an error ... for the others, we keep ...

@akosthekiss
Copy link
Member

If my last comment gets fixed, LGTM

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com

## Termination

It is questionable whether a library should be able to terminate an application. Any API function can signal an error (ex.: cannot allocate memory), so the engine use the termination approach with this port function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the "It is questionable whether a library should be able to terminate an application. " because the next sentence has no logical relation to it.

@LaszloLango LaszloLango merged commit 2a354b2 into jerryscript-project:master Sep 1, 2016
@LaszloLango LaszloLango mentioned this pull request Sep 1, 2016
@LaszloLango LaszloLango deleted the jerry-port-how-to branch September 8, 2016 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development Feature implementation documentation Related to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants