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

Add version functions to LFE #299

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

oubiwann
Copy link
Member

@oubiwann oubiwann commented Nov 17, 2016

Fixes #297.

Add support for a version function as well as other "system info" functions. Tasks:

  • provide Erlang, LFE, OS, and tools version info
  • allow users to only provide the version of a single entry, if they so wish
  • use an extensible and backwards compatible data structure (property list)
  • provide convenience macros for use by developers in the REPL (e.g., (version) and (version 'app-nam))
  • ensure new functions are accessible from any LFE module
  • cache expensive calls
    • memoize where sensible to mitigate expensive system calls
    • refactor memoization to instead use the processes table (see @rvirding's comment below)
  • add documentation
    • update lfe_shell.md
    • update lfe.1.md

Bonus tasks:

  • add missing docs for Common Lisp module

@yurrriq yurrriq mentioned this pull request Nov 17, 2016
15 tasks
@oubiwann
Copy link
Member Author

I've updated the docs with formatting fixes.

@oubiwann
Copy link
Member Author

@rvirding Is there any chance we could get this into the 1.2.1 release? I've been dying for this version function in LFE for ages ... it would be nice to clean up all the duplicate version-getting code in all the different LFE libraries ...

@yurrriq
Copy link
Contributor

yurrriq commented Nov 21, 2016

👍 I'd like to see (or write myself) a patch for #286 in 1.2.1 as well.

@rvirding
Copy link
Member

I have a few comments:

  • I don't think we should add a macro for version/0/1, no need for it.
  • Should it be stored in each process dictionary? An alternative would be to keep it in an ets table owned by the init process with a global name, lfe-version-info.
  • Shouldn't all the otp versions have the same format, not "R16B3" and "19.1"? Would make comparisons easier.
  • Could generate LFE version at compile time and use that in code.

@rvirding
Copy link
Member

rvirding commented Nov 21, 2016 via email

@oubiwann
Copy link
Member Author

@rvirding regarding version macros:

I'd like to be able to call (version) and (version 'appname) from the REPL. This is a common use case in other language REPL/shells and have found it to be quite a nice convenience. In our case, we do get the version number in the banner for LFE itself, but it would still be nice to have a short command to use for getting versions of other applications as well.

@oubiwann
Copy link
Member Author

oubiwann commented May 7, 2019

Will rebase and address the review feedback ...

@oubiwann
Copy link
Member Author

I've updated to rebase off of the LFE 2.0 code base in develop.

@oubiwann oubiwann modified the milestones: 1.3.1, 2.1 Oct 14, 2020
@oubiwann oubiwann marked this pull request as draft October 14, 2020 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a version function
3 participants