Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Implement DateTime within Ergo #345

Open
kach opened this issue Jul 25, 2018 · 8 comments
Open

Implement DateTime within Ergo #345

kach opened this issue Jul 25, 2018 · 8 comments
Labels
Difficulty: Starter Good First Issue :octocat: Good for newcomers Help Wanted 🆘 Extra attention is needed

Comments

@kach
Copy link
Contributor

kach commented Jul 25, 2018

This can be done now that we have importing working. Implementing DateTime within Ergo would:

  1. Simplify the compiler because we don't have to deal with foreign data
  2. Save us the trouble of implementing native datetime support in every backend
  3. Give us free eval for datetime operations, e.g. in the REPL
@kach kach added Help Wanted 🆘 Extra attention is needed Good First Issue :octocat: Good for newcomers labels Jul 25, 2018
@kach
Copy link
Contributor Author

kach commented Jul 25, 2018

This is a good issue for contributors because it doesn't require any knowledge of compiler internals; all the code would be written in Ergo itself.

@mbtamuli
Copy link

Can I work on this issue?

@mbtamuli
Copy link

Can someone provide a hint or pointer as to what needs to be done?

@jeromesimeon
Copy link
Member

@mbtamuli Sorry for the lag, we're in the middle of a release which makes it hard to track everything.

This is a great issue to pick! Also a pretty ambitious one. Ultimately the goal would be to re-implement the date and time library in Ergo (currently based on the primitive type DateTime) directly as an Ergo library. The current date and time library is documented here: https://docs.accordproject.org/docs/ref-logic-stdlib.html#functions-on-datetime and parsing/printing of DateTime values is based on the ISO 8601 standard: https://en.wikipedia.org/wiki/ISO_8601

If you consider all the different ways people write dates, issues with timezones, leap years, etc. I could consider this a fairly challenging issue to tackle, so I wouldn't try to do everything at once, but start with a more bite size task first.

That could simply look like:

  1. Create a separate ErgoDateTime structure that captures date/time information (year, month, etc)
  2. Assume everything is in UTC (so not try to tackle timezones)
  3. Not try to address parsing/serialization for the time being, but instead have functions to convert between the current DateTime and the new ErgoDateTime

Let me know if you think that makes sense. Also feel free to join the Ergo calls on Friday morning (9am EST) -- information about those can be found on the #technology-ergo channel on the Accord Project Slack!

@mbtamuli
Copy link

Won't be able to work on this immediately. @irmerk you can reassign to someone else if they want to take this up.

@jeromesimeon jeromesimeon removed the Hacktoberfest by DigitalOcean and DEV label Nov 11, 2019
@Anjani-225
Copy link

Hey
Could I work on this issue?

@jeromesimeon
Copy link
Member

Sure @Anjani-225 !

Anjani-225 added a commit to Anjani-225/ergo that referenced this issue Mar 22, 2020
<feat>(<extraction -> stdlib -> ergodatetime>): <new date time library writtern completely in ergo language ,writtern so as to save maximum gas when deployed on any chain in the future> - <Issue accordproject#345 -implement DateTime within Ergo>
@Anjani-225
Copy link

Hello
Ive implemented a new library with has the DateTime library in ergo itself in this pull request.
I have drafted the library keeping in mind the gas costs.
I have ignored time zones for now.
Please do let me know on how to improve upon it.

Anjani-225 added a commit to Anjani-225/ergo that referenced this issue Mar 22, 2020
…y writtern completely in ergo language ,writtern so as to save maximum gas when deployed on any chain> - <Issue accordproject#345 -implement DateTime in Ergo>

<feat>(<extraction -> stdlib -> ergodatetime>): <new date time library writtern completely in ergo language ,writtern so as to save maximum gas when deployed on any chain> - <Issue accordproject#345 -implement DateTime in Ergo>
This is my commit message
Signed-off-by: Anjani-225 <anjaninair1026@gmail.com>
Anjani-225 added a commit to Anjani-225/ergo that referenced this issue Mar 22, 2020
…y writtern completely in ergo language ,writtern so as to save maximum gas when deployed on any chain> - <Issue accordproject#345 -implement DateTime in Ergo>   Signed-off-by: Anjani-225 <anjaninair1026@gmail.com>

<feat>(<extraction -> stdlib -> ergodatetime>): <new date time library writtern completely in ergo language ,writtern so as to save maximum gas when deployed on any chain> - <Issue accordproject#345 -implement DateTime in Ergo>

This is my commit message

Signed-off-by: Anjani-225 <anjaninair1026@gmail.com>
Anjani-225 added a commit to Anjani-225/ergo that referenced this issue Mar 23, 2020
<feat>(<extraction -> stdlib -> ergodatetime>): <new date time library writtern completely in ergo language ,writtern so as to save maximum gas when deployed on any chain in the future> - <Issue accordproject#345 -implement DateTime within Ergo>

Signed-off-by: AJ <anjaninair1026@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Starter Good First Issue :octocat: Good for newcomers Help Wanted 🆘 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants