caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] PPX is harmful to our community in the long term
@ 2017-04-23  0:06 Hongbo Zhang (BLOOMBERG/ 731 LEX)
  2017-04-23  1:25 ` Yaron Minsky
  0 siblings, 1 reply; 23+ messages in thread
From: Hongbo Zhang (BLOOMBERG/ 731 LEX) @ 2017-04-23  0:06 UTC (permalink / raw)
  To: robert.muller2; +Cc: ssp.mryau, caml-list

[-- Attachment #1: Type: text/plain, Size: 3934 bytes --]

Exactly, for companies like janestreet, they may not feel its pain since they didn't depend on external ppx, release software only works on latest compilers, and have a very good orientation section about those conventions, it makes perfect sense under such internal organizations.

But for external open source communities, it's too bad that PPX is so widely used, migrate-parsetree maybe useful, but it adds yet another layer of complexity, the real solution is checking in generated code which will cut the dependency completely or just don't use ppx.

Anyway , I don't want to make anyone unhappy, but I believe acknowledging what the awesome OCaml language offers and keeping build high quality software instead of writing ppx is the right way to benefit our community . People built amazing software in less expressive languages like GoLang, I am sure we can do much better!

----- Original Message -----
From: Robert Muller <robert.muller2@gmail.com>
To: HONGBO ZHANG
CC: caml-list@inria.fr, ssp.mryau@gmail.com
At: 22-Apr-2017 15:47:47


The VAX Fortran compiler was a state-of-the-art compiler in its day. The compiler was implemented in BLISS, a systems programming language with a powerful macro system. Each compiler developer invariably authored their own macros to suit their styles. So when one wandered into foreign bits of the compiler they appeared to be written in different dialects of BLISS. We had the dialects of the present developers as well as legacy dialects from years of earlier developers. It was not for nothing that our development machine was called "Babel". 
New hires faced a steeper slope in mastering the compiler than they would have had there been no macros. I concluded that macros, at least managed in that style, were injurious to the engineering process.
- Bob Muller


On Sat, Apr 22, 2017 at 10:47 AM, Hongbo Zhang (BLOOMBERG/ 731 LEX) <hzhang295@bloomberg.net> wrote:

Yes, I agree it's useful , and that's why I wrote hundreds of thousands of lines of code in syntactic meta-programming (camlp4, fan, ppx)
But in the end of day, the conclusion is the cost is just so huge that it should not be widely used, at least , it should not be *leaked* to end users. ( I remember I had a conversation with the original maintainer of camlp4, Nicolas, about 5 years ago, he had similar ideas with me)


----- Original Message -----
From: Serge Sivkov <ssp.mryau@gmail.com>
To: caml-list@inria.fr
At: 22-Apr-2017 08:49:40


Hence, my two cents: PPX has problems in cross-compilation use cases, but I suppose something like new tag in META can reslove this issue.
As for me, just ppx_deriving* by whitequark is yet one example of usefullness of PPX.

WBR, ssp

2017-04-22 5:10 GMT+06:00 Emilio Jesús Gallego Arias <e@x80.org>:

"Hongbo Zhang (BLOOMBERG/ 731 LEX)" <hzhang295@bloomberg.net> writes:

> Yes, that's exactly what I suggested in the beginning!

Maybe I interpret the word "harmful" differently, but IMVHO I have to
strongly disagree with your choice of subject in the original mail.

Not only PPX has not been harmful for me, but it has been a life-saver
tool that has enabled significant progress towards more productive
research.

"Hongbo Zhang (BLOOMBERG/ 731 LEX)" <hzhang295@bloomberg.net> writes:

> calling it 'madness' is disrespectful

Personally, I fully subscribe Yaron's message and I see nothing
disrespectful in suggesting that abandoning syntactic abstractions is a
very bad idea.

You wrote:

 "the OCaml library developer should avoid PPX as much as you can",

but if you meant:

 "PPX seems quite unstable these days, I wonder how could we improve
  long-term stability?"

I'd have to admit that message didn't reach to me.

Best regards!
Emilio

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



[-- Attachment #2: Type: text/html, Size: 9473 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [Caml-list] PPX is harmful to our community in the long term
@ 2017-04-22 14:47 Hongbo Zhang (BLOOMBERG/ 731 LEX)
  2017-04-22 19:47 ` Robert Muller
  0 siblings, 1 reply; 23+ messages in thread
From: Hongbo Zhang (BLOOMBERG/ 731 LEX) @ 2017-04-22 14:47 UTC (permalink / raw)
  To: ssp.mryau, caml-list

[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]

Yes, I agree it's useful , and that's why I wrote hundreds of thousands of lines of code in syntactic meta-programming (camlp4, fan, ppx)
But in the end of day, the conclusion is the cost is just so huge that it should not be widely used, at least , it should not be *leaked* to end users. ( I remember I had a conversation with the original maintainer of camlp4, Nicolas, about 5 years ago, he had similar ideas with me)

----- Original Message -----
From: Serge Sivkov <ssp.mryau@gmail.com>
To: caml-list@inria.fr
At: 22-Apr-2017 08:49:40


Hence, my two cents: PPX has problems in cross-compilation use cases, but I suppose something like new tag in META can reslove this issue.
As for me, just ppx_deriving* by whitequark is yet one example of usefullness of PPX.

WBR, ssp

2017-04-22 5:10 GMT+06:00 Emilio Jesús Gallego Arias <e@x80.org>:

"Hongbo Zhang (BLOOMBERG/ 731 LEX)" <hzhang295@bloomberg.net> writes:

> Yes, that's exactly what I suggested in the beginning!

Maybe I interpret the word "harmful" differently, but IMVHO I have to
strongly disagree with your choice of subject in the original mail.

Not only PPX has not been harmful for me, but it has been a life-saver
tool that has enabled significant progress towards more productive
research.

"Hongbo Zhang (BLOOMBERG/ 731 LEX)" <hzhang295@bloomberg.net> writes:

> calling it 'madness' is disrespectful

Personally, I fully subscribe Yaron's message and I see nothing
disrespectful in suggesting that abandoning syntactic abstractions is a
very bad idea.

You wrote:

 "the OCaml library developer should avoid PPX as much as you can",

but if you meant:

 "PPX seems quite unstable these days, I wonder how could we improve
  long-term stability?"

I'd have to admit that message didn't reach to me.

Best regards!
Emilio

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



[-- Attachment #2: Type: text/html, Size: 4965 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [Caml-list] PPX is harmful to our community in the long term
@ 2017-04-21 21:48 Hongbo Zhang (BLOOMBERG/ 731 LEX)
  2017-04-21 23:10 ` Emilio Jesús Gallego Arias
  0 siblings, 1 reply; 23+ messages in thread
From: Hongbo Zhang (BLOOMBERG/ 731 LEX) @ 2017-04-21 21:48 UTC (permalink / raw)
  To: Fabrice.Le_fessant, yminsky; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 4886 bytes --]

Yes, that's exactly what I suggested in the beginning! 
calling it 'madness' is disrespectful 

----- Original Message -----
From: Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
To: HONGBO ZHANG, yminsky@janestreet.com
CC: caml-list@inria.fr
At: 21-Apr-2017 17:18:32


A lot of people use `autoconf` to generate `./configure` scripts, and the standard practice is to keep the `./configure` script so that people don't need to run `autoconf` to just compile and install the software. Maybe projects could do the same with ppx, i.e. store pre-processed files in the project sources so that the ppx would only be needed when the developer modifies the sources. For example, there could be a `_ppx` directory, where pre-processed files would be stored under the hash of a combination of their original source code and the  `-ppx` arguments. The compiler (or the build system) would use these files when available instead of calling the ppx. That might reduce the problem at least for `opam`, since users are not supposed to edit the packages when installing them.
On Fri, Apr 21, 2017 at 9:24 PM Hongbo Zhang (BLOOMBERG/ 731 LEX) <hzhang295@bloomberg.net> wrote:

Yes, when you never depend on other people's PPX, it is perfectly fine to provide a customized
suite of PPX. 
Think about the software which only works against 4.03, 4.04, this is equivalent to say that you release
a c++ library only works with gcc 7 while most enterprises are still using 4.8, nobody even think it is a 
serious piece of software.
It is a different story in Haskell deriving or Scheme macro system, there is no issue that you software 
in use today will be not compilable in the future.

From: yminsky@janestreet.com At: 04/21/17 15:12:29
To: Hongbo Zhang (BLOOMBERG/ 731 LEX)
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] PPX is harmful to our community in the long term

I understand the frustration, but I think your conclusion is
misplaced. PPXs are massively helpful when building serious software.
Having automatic generation of pretty-printers, comparison functions,
hash functions, binary protocols, and the like is a huge win for both
programmer efficiency and correctness. The Haskell folk aren't wrong
to care about deriving, and the schemers aren't crazy to want their
macro systems.

In short, I think abandoning syntactic abstractions is madness.

I agree that the portability problems are serious and should be
addressed, but ocaml-migrate-parsetree seems like a solid step in the
right direction.

y

On Fri, Apr 21, 2017 at 11:41 AM, Hongbo Zhang (BLOOMBERG/ 731 LEX)
<hzhang295@bloomberg.net> wrote:
> Dear OCaml developers:
> Given that bitten by PPX from time to time, finally, I think it is a time to
> spend two hours sharing my experience with PPX and why you(the OCaml library
> developer) should avoid PPX as much as you can.
>
> Here is a story I just experienced this morning, I tried to install a
> package from opam, and it complained my compiler is too old - 4.02.3, to be
> honest, 4.02.3 is still a pretty modern OCaml compiler, even debian stable
> still stays on 4.01. Anyway, I switched to 4.04.1, after half an hour, it
> failed to compile again, complaning about some ppx error message. This is
> not my first time experience, and finally it made me to write an essay about
> why PPX is harmful.
> PPX is a compiler plugin, it imposes a very large compiler surface API to
> your library, and we don't have any backward compatibility guarantee from
> the compiler, which means your library will only work against a specific
> compiler. Even worse, OCaml is an elegant but small community, we don't have
> too many maintainers for a library, if you have a library which relies on
> PPX (the dependency chain could be really really huge, for example,
> ppx_metaquot depends on typing environment, you can find lots of stories
> about node_modules in Node community), it will probably not work against
> next version of OCaml compiler, and it will be a huge maintenance overhead
> for other people to pick it up.
>
> OCaml is already a very expressive language, probably more expressive than
> any other mainstream language, (Go, Java, C/C++, etc), it is fine to write
> some boilerplate code, or we can cut PPX as a dev dependency, after your
> PPXed your code, check in the generated source code(via -dsource), so it
> will not bring dependency to end users.
> There are some valid use cases of PPX, for example, in BuckleScript or
> JS_of_OCaml, we want to customize OCaml language a bit for external FFI, or
> if you have a very large team, and committed effort to maintain your PPX.
> Happy hacking in OCaml without PPX, Thanks -- Hongbo
>
>


--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



[-- Attachment #2: Type: text/html, Size: 9463 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [Caml-list] PPX is harmful to our community in the long term
@ 2017-04-21 19:23 Hongbo Zhang (BLOOMBERG/ 731 LEX)
  2017-04-21 21:17 ` Fabrice Le Fessant
  0 siblings, 1 reply; 23+ messages in thread
From: Hongbo Zhang (BLOOMBERG/ 731 LEX) @ 2017-04-21 19:23 UTC (permalink / raw)
  To: yminsky; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 3724 bytes --]

Yes, when you never depend on other people's PPX, it is perfectly fine to provide a customized
suite of PPX. 
Think about the software which only works against 4.03, 4.04, this is equivalent to say that you release
a c++ library only works with gcc 7 while most enterprises are still using 4.8, nobody even think it is a 
serious piece of software.
It is a different story in Haskell deriving or Scheme macro system, there is no issue that you software 
in use today will be not compilable in the future.

From: yminsky@janestreet.com At: 04/21/17 15:12:29
To: Hongbo Zhang (BLOOMBERG/ 731 LEX)
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] PPX is harmful to our community in the long term

I understand the frustration, but I think your conclusion is
misplaced. PPXs are massively helpful when building serious software.
Having automatic generation of pretty-printers, comparison functions,
hash functions, binary protocols, and the like is a huge win for both
programmer efficiency and correctness. The Haskell folk aren't wrong
to care about deriving, and the schemers aren't crazy to want their
macro systems.

In short, I think abandoning syntactic abstractions is madness.

I agree that the portability problems are serious and should be
addressed, but ocaml-migrate-parsetree seems like a solid step in the
right direction.

y

On Fri, Apr 21, 2017 at 11:41 AM, Hongbo Zhang (BLOOMBERG/ 731 LEX)
<hzhang295@bloomberg.net> wrote:
> Dear OCaml developers:
> Given that bitten by PPX from time to time, finally, I think it is a time to
> spend two hours sharing my experience with PPX and why you(the OCaml library
> developer) should avoid PPX as much as you can.
>
> Here is a story I just experienced this morning, I tried to install a
> package from opam, and it complained my compiler is too old - 4.02.3, to be
> honest, 4.02.3 is still a pretty modern OCaml compiler, even debian stable
> still stays on 4.01. Anyway, I switched to 4.04.1, after half an hour, it
> failed to compile again, complaning about some ppx error message. This is
> not my first time experience, and finally it made me to write an essay about
> why PPX is harmful.
> PPX is a compiler plugin, it imposes a very large compiler surface API to
> your library, and we don't have any backward compatibility guarantee from
> the compiler, which means your library will only work against a specific
> compiler. Even worse, OCaml is an elegant but small community, we don't have
> too many maintainers for a library, if you have a library which relies on
> PPX (the dependency chain could be really really huge, for example,
> ppx_metaquot depends on typing environment, you can find lots of stories
> about node_modules in Node community), it will probably not work against
> next version of OCaml compiler, and it will be a huge maintenance overhead
> for other people to pick it up.
>
> OCaml is already a very expressive language, probably more expressive than
> any other mainstream language, (Go, Java, C/C++, etc), it is fine to write
> some boilerplate code, or we can cut PPX as a dev dependency, after your
> PPXed your code, check in the generated source code(via -dsource), so it
> will not bring dependency to end users.
> There are some valid use cases of PPX, for example, in BuckleScript or
> JS_of_OCaml, we want to customize OCaml language a bit for external FFI, or
> if you have a very large team, and committed effort to maintain your PPX.
> Happy hacking in OCaml without PPX, Thanks -- Hongbo
>
>

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



[-- Attachment #2: Type: text/html, Size: 5588 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [Caml-list] PPX is harmful to our community in the long term
@ 2017-04-21 15:41 Hongbo Zhang (BLOOMBERG/ 731 LEX)
  2017-04-21 16:04 ` Yotam Barnoy
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Hongbo Zhang (BLOOMBERG/ 731 LEX) @ 2017-04-21 15:41 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 2031 bytes --]

Dear OCaml developers:
   Given that  bitten by PPX from time to time, finally, I think it is a time to spend two hours sharing my experience with PPX and why you(the OCaml library developer) should avoid PPX as much as you can.

   Here is a story I just experienced this morning, I tried to install a package from opam, and it complained my compiler is too old - 4.02.3, to be honest, 4.02.3 is still a pretty modern OCaml compiler, even debian stable still stays on 4.01. Anyway, I switched to 4.04.1, after half an hour, it failed to compile again, complaning about some ppx error message. This is not my first time experience, and finally it made me to write an essay about why PPX is harmful.
  
    PPX is a compiler plugin, it imposes a very large compiler surface API to your library, and we don't have any backward compatibility guarantee from the compiler, which means your library will only work against a specific compiler. Even worse, OCaml is an elegant but small community, we don't have too many maintainers for a library, if you have a library which relies on PPX (the dependency chain could be really really huge, for example, ppx_metaquot depends on typing environment, you can find lots of stories about node_modules in Node community), it will probably not work against next version of OCaml compiler, and it will be a huge maintenance overhead for other people to pick it up.

    OCaml is already a very expressive language, probably more expressive than any other mainstream language, (Go, Java, C/C++, etc), it is fine to write some boilerplate code, or we can cut PPX as a dev dependency, after your PPXed your code, check in the generated source code(via -dsource), so it will not bring dependency to end users.
   
    There are some valid use cases of PPX, for example, in BuckleScript or JS_of_OCaml, we want to customize OCaml language a bit for external FFI, or if you have a very large team, and committed effort to maintain your PPX.
  
    Happy hacking in OCaml without PPX, Thanks -- Hongbo



[-- Attachment #2: Type: text/html, Size: 2642 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2017-05-11  9:37 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-23  0:06 [Caml-list] PPX is harmful to our community in the long term Hongbo Zhang (BLOOMBERG/ 731 LEX)
2017-04-23  1:25 ` Yaron Minsky
  -- strict thread matches above, loose matches on Subject: below --
2017-04-22 14:47 Hongbo Zhang (BLOOMBERG/ 731 LEX)
2017-04-22 19:47 ` Robert Muller
2017-04-23  1:30   ` Yaron Minsky
2017-04-21 21:48 Hongbo Zhang (BLOOMBERG/ 731 LEX)
2017-04-21 23:10 ` Emilio Jesús Gallego Arias
2017-04-22 12:49   ` Serge Sivkov
2017-04-21 19:23 Hongbo Zhang (BLOOMBERG/ 731 LEX)
2017-04-21 21:17 ` Fabrice Le Fessant
2017-04-28 11:07   ` Olaf Hering
2017-04-28 13:04     ` Anil Madhavapeddy
2017-04-28 14:50       ` Yaron Minsky
2017-04-28 14:55         ` Jacques Carette
2017-05-11  9:37           ` Jeremie Dimino
2017-04-21 15:41 Hongbo Zhang (BLOOMBERG/ 731 LEX)
2017-04-21 16:04 ` Yotam Barnoy
2017-04-21 16:43   ` Gerd Stolpmann
2017-04-21 17:11   ` Alain Frisch
2017-04-21 18:28     ` Jeremie Dimino
2017-04-21 16:55 ` Francois BERENGER
2017-04-21 19:11 ` Yaron Minsky
2017-04-21 19:22 ` Emilio Jesús Gallego Arias

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).