[ANN] otp_vsn 1.0.0 - ?OTP_VSN

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] otp_vsn 1.0.0 - ?OTP_VSN

Pierre Fenoll-2
Howdy people,

I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases.

This saves you the copy/pasting/tweaking of erl_opts's platform_define.
Header-only, no dependencies. Supports releases from R16B01 to latest.

For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE).

This release is super fresh (published 15 minutes ago) and feedback is welcomed!
I'm looking for macros that are re-defined often such as
* the maps thing I mention above
* stdlib types getting renamed
* functions being moved/renamed

I think this library could be the place to put them in & help the community write code that still compiles on newer releases of Erlang :)


Thanks & have a nice day

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] otp_vsn 1.0.0 - ?OTP_VSN

Marc Worrell

> On 20 Apr 2018, at 12:51, Pierre Fenoll <[hidden email]> wrote:
>
> I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases.
>
> For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE).

Nice work, I especially like that it is only a header file.

I have an idea, might be somethiing to add.
Instead of relying on the OTP version for some features.
Maybe add a macro like ‘OTP_SUPPORT_MAPS’ ?

Another we often define is for the changes in the dict() type, which became dict:dict() at some point.

In our rebar files we currently have definitions for this kind of defines.
Would be very convenient to have those at a more central place, and one that is consistent between projects.

Thank you for your library!

Marc Worrell


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] otp_vsn 1.0.0 - ?OTP_VSN

Pierre Fenoll-2
@Marc Worrell
Thanks for the kind words! The end goal is exactly that and I am working on defining the expected macros in a way that makes sense.
Any input appreciated, notable edge cases, ...

@Loïc Hoguin
Thanks for taking a look! So I think I have pushed a v1 too early: *_AND_ABOVE and *_AND_BELOW are both inclusive of the current OTP version.
I'm thinking of dropping the *_AND_BELOW and using a common macro prefix anyway... It's already time for a v2!



Cheers,
-- 
Pierre Fenoll


On 20 April 2018 at 13:08, Marc Worrell <[hidden email]> wrote:

> On 20 Apr 2018, at 12:51, Pierre Fenoll <[hidden email]> wrote:
>
> I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases.
>
> For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE).

Nice work, I especially like that it is only a header file.

I have an idea, might be somethiing to add.
Instead of relying on the OTP version for some features.
Maybe add a macro like ‘OTP_SUPPORT_MAPS’ ?

Another we often define is for the changes in the dict() type, which became dict:dict() at some point.

In our rebar files we currently have definitions for this kind of defines.
Would be very convenient to have those at a more central place, and one that is consistent between projects.

Thank you for your library!

Marc Worrell




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] otp_vsn 1.0.0 - ?OTP_VSN

Loïc Hoguin-3
The problem with *_AND_BELOW is not that it's inclusive of the OTP
version. It's that it only contains said OTP version. There's no
-define(OTP_19_AND_BELOW, 1) for OTP-18 for example.

On 04/20/2018 04:29 PM, Pierre Fenoll wrote:

> @Marc Worrell
> Thanks for the kind words! The end goal is exactly that and I am working
> on defining the expected macros in a way that makes sense.
> Any input appreciated, notable edge cases, ...
>
> @Loïc Hoguin
> Thanks for taking a look! So I think I have pushed a v1 too early:
> *_AND_ABOVE and *_AND_BELOW are both inclusive of the current OTP version.
> I'm thinking of dropping the *_AND_BELOW and using a common macro prefix
> anyway... It's already time for a v2!
>
>
>
> Cheers,
> --
> Pierre Fenoll
>
>
> On 20 April 2018 at 13:08, Marc Worrell <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>     > On 20 Apr 2018, at 12:51, Pierre Fenoll <[hidden email] <mailto:[hidden email]>> wrote:
>     >
>     > I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases.
>     >
>     > For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE).
>
>     Nice work, I especially like that it is only a header file.
>
>     I have an idea, might be somethiing to add.
>     Instead of relying on the OTP version for some features.
>     Maybe add a macro like ‘OTP_SUPPORT_MAPS’ ?
>
>     Another we often define is for the changes in the dict() type, which
>     became dict:dict() at some point.
>
>     In our rebar files we currently have definitions for this kind of
>     defines.
>     Would be very convenient to have those at a more central place, and
>     one that is consistent between projects.
>
>     Thank you for your library!
>
>     Marc Worrell
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>

--
Loïc Hoguin
https://ninenines.eu
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] otp_vsn 1.0.0 - ?OTP_VSN

Heinz N. Gies
In reply to this post by Pierre Fenoll-2
Hey I’ve been maintaining a rebar plugin for this for quite a while https://github.com/project-fifo/rebar_erl_vsn I’m curious as to why a new library instead of contributing? Did it cause you problems or not solve a problem you encountered?

Cheers,
Heinz 

On 20. Apr 2018, at 12:51, Pierre Fenoll <[hidden email]> wrote:

Howdy people,

I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases.

This saves you the copy/pasting/tweaking of erl_opts's platform_define.
Header-only, no dependencies. Supports releases from R16B01 to latest.

For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE).

This release is super fresh (published 15 minutes ago) and feedback is welcomed!
I'm looking for macros that are re-defined often such as
* the maps thing I mention above
* stdlib types getting renamed
* functions being moved/renamed

I think this library could be the place to put them in & help the community write code that still compiles on newer releases of Erlang :)


Thanks & have a nice day
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] otp_vsn 1.0.0 - ?OTP_VSN

Pierre Fenoll-2
Oh well I didn’t know about this! Sorry about that I’ll take a look and discuss there. 
I need to work on other.erldocs.com and add a real search engine...

On Fri 20 Apr 2018 at 17:19, Heinz N. Gies <[hidden email]> wrote:
Hey I’ve been maintaining a rebar plugin for this for quite a while https://github.com/project-fifo/rebar_erl_vsn I’m curious as to why a new library instead of contributing? Did it cause you problems or not solve a problem you encountered?

Cheers,
Heinz 

On 20. Apr 2018, at 12:51, Pierre Fenoll <[hidden email]> wrote:

Howdy people,

I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases.

This saves you the copy/pasting/tweaking of erl_opts's platform_define.
Header-only, no dependencies. Supports releases from R16B01 to latest.

For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE).

This release is super fresh (published 15 minutes ago) and feedback is welcomed!
I'm looking for macros that are re-defined often such as
* the maps thing I mention above
* stdlib types getting renamed
* functions being moved/renamed

I think this library could be the place to put them in & help the community write code that still compiles on newer releases of Erlang :)


Thanks & have a nice day
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
--

Cheers,
-- 
Pierre Fenoll


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] otp_vsn 1.0.0 - ?OTP_VSN

Heinz N. Gies
Ah no reason for being sorry, it’s super easy to miss existing stuff ;) I just was curious if it’s a “I didn't find this” or a “this is horrible!” Kind of new library :), cause I would have tried to fix #2!

On 20. Apr 2018, at 18:49, Pierre Fenoll <[hidden email]> wrote:

Oh well I didn’t know about this! Sorry about that I’ll take a look and discuss there. 
I need to work on other.erldocs.com and add a real search engine...

On Fri 20 Apr 2018 at 17:19, Heinz N. Gies <[hidden email]> wrote:
Hey I’ve been maintaining a rebar plugin for this for quite a while https://github.com/project-fifo/rebar_erl_vsn I’m curious as to why a new library instead of contributing? Did it cause you problems or not solve a problem you encountered?

Cheers,
Heinz 

On 20. Apr 2018, at 12:51, Pierre Fenoll <[hidden email]> wrote:

Howdy people,

I just released a library called otp_vsn which defines helpful macros if you write code that spans multiple OTP releases.

This saves you the copy/pasting/tweaking of erl_opts's platform_define.
Header-only, no dependencies. Supports releases from R16B01 to latest.

For example if you want to use the #{maps => syntax} but still be able to compile your code on releases earlier than 17.5 you can use ifdef(OTP_VSN_17_AND_ABOVE).

This release is super fresh (published 15 minutes ago) and feedback is welcomed!
I'm looking for macros that are re-defined often such as
* the maps thing I mention above
* stdlib types getting renamed
* functions being moved/renamed

I think this library could be the place to put them in & help the community write code that still compiles on newer releases of Erlang :)


Thanks & have a nice day
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
--

Cheers,
-- 
Pierre Fenoll



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] otp_vsn 1.0.0 - ?OTP_VSN

PAILLEAU Eric
In reply to this post by Pierre Fenoll-2
Hi Pierre,

> I'm looking for macros that are re-defined often such as
> * the maps thing I mention above
> * stdlib types getting renamed
> * functions being moved/renamed

As en entry point, you can have a look to release diffs I did for geas tool.
in Yaml format :

https://github.com/crownedgrouse/geas_devel/tree/master/doc/reldiffs/yaml

as well Erlang term format :
https://github.com/crownedgrouse/geas_devel/tree/master/doc/reldiffs/term

This will tell you what module/function was added/removed between two
subsequent releases.

This may help to create missing macros, possibly by automatic process...

regards
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions