ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:115598] [Ruby master Bug#20044] Add runtime flag and environment variable for prism
@ 2023-12-06  1:30 HParker (Adam Hess) via ruby-core
  2023-12-06  1:59 ` [ruby-core:115599] " HParker (Adam Hess) via ruby-core
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: HParker (Adam Hess) via ruby-core @ 2023-12-06  1:30 UTC (permalink / raw
  To: ruby-core; +Cc: HParker (Adam Hess)

Issue #20044 has been reported by HParker (Adam Hess).

----------------------------------------
Bug #20044: Add runtime flag and environment variable for prism
https://bugs.ruby-lang.org/issues/20044

* Author: HParker (Adam Hess)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled. 

The flags could be,

```
ruby --prism test.rb
```

and the environment variable could be,

```
RUBY_PRISM=1 ruby test.rb
```

Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen.

Things to be sure to discuss mentioned by @mame,

> * What to do with the command-line option when prism becomes the default parser in the future.
>  ** Just remove it, or leave it as a "do nothing" option?
> * What are the appropriate names.
> ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short.
> * Whether to print a warning when this mode is used.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:115599] [Ruby master Bug#20044] Add runtime flag and environment variable for prism
  2023-12-06  1:30 [ruby-core:115598] [Ruby master Bug#20044] Add runtime flag and environment variable for prism HParker (Adam Hess) via ruby-core
@ 2023-12-06  1:59 ` HParker (Adam Hess) via ruby-core
  2023-12-06 12:59 ` [ruby-core:115606] " Eregon (Benoit Daloze) via ruby-core
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: HParker (Adam Hess) via ruby-core @ 2023-12-06  1:59 UTC (permalink / raw
  To: ruby-core; +Cc: HParker (Adam Hess)

Issue #20044 has been updated by HParker (Adam Hess).


I am happy to adopt any direction the core team likes for this proposal, but to attempt answers to @mame's questions, I would suggest,

> What to do with the command-line option when prism becomes the default parser in the future.

I believe we can safely begin ignoring the environment variable when prism becomes the default parser without any work (just deleting code). I think deprecating the runtime flag version with a message is reasonable one release after it becomes the default, but I don't have a strong opinion here and I defer to whatever Ruby has typically done in the past.

> What are the appropriate names.

I was unaware of this naming convention and I believe in the first release including prism as an option, this should be targeted towards people who are sure this is what they want. My intention with this change is to allow those interested in testing prism to begin doing that. I would like to integrate it into CI and begin testing Ruby HEAD with it enabled when that becomes possible.

>  Whether to print a warning when this mode is used.

I am conflicted on this. `RubyVM::InstructionSequence.compile_prism` does not outputs a warning. I suspect using Prism as your default parser is **more** experimental than using prism via this API, but I am not sure how much more experimental. I suspect if we plan to remove the flag, at least using the flag should warn, but I don't have strong feelings about this either.

----------------------------------------
Bug #20044: Add runtime flag and environment variable for prism
https://bugs.ruby-lang.org/issues/20044#change-105529

* Author: HParker (Adam Hess)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled. 

The flags could be,

```
ruby --prism test.rb
```

and the environment variable could be,

```
RUBY_PRISM=1 ruby test.rb
```

Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen.

Things to be sure to discuss mentioned by @mame,

> * What to do with the command-line option when prism becomes the default parser in the future.
>  ** Just remove it, or leave it as a "do nothing" option?
> * What are the appropriate names.
> ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short.
> * Whether to print a warning when this mode is used.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:115606] [Ruby master Bug#20044] Add runtime flag and environment variable for prism
  2023-12-06  1:30 [ruby-core:115598] [Ruby master Bug#20044] Add runtime flag and environment variable for prism HParker (Adam Hess) via ruby-core
  2023-12-06  1:59 ` [ruby-core:115599] " HParker (Adam Hess) via ruby-core
@ 2023-12-06 12:59 ` Eregon (Benoit Daloze) via ruby-core
  2023-12-06 13:40 ` [ruby-core:115608] " eightbitraptor (Matthew Valentine-House) via ruby-core
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2023-12-06 12:59 UTC (permalink / raw
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #20044 has been updated by Eregon (Benoit Daloze).


I think a warning would cause some incompatibility and is not necessary, instead the flag & env var can be documented as experimental.

----------------------------------------
Bug #20044: Add runtime flag and environment variable for prism
https://bugs.ruby-lang.org/issues/20044#change-105537

* Author: HParker (Adam Hess)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled. 

The flags could be,

```
ruby --prism test.rb
```

and the environment variable could be,

```
RUBY_PRISM=1 ruby test.rb
```

Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen.

Things to be sure to discuss mentioned by @mame,

> * What to do with the command-line option when prism becomes the default parser in the future.
>  ** Just remove it, or leave it as a "do nothing" option?
> * What are the appropriate names.
> ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short.
> * Whether to print a warning when this mode is used.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:115608] [Ruby master Bug#20044] Add runtime flag and environment variable for prism
  2023-12-06  1:30 [ruby-core:115598] [Ruby master Bug#20044] Add runtime flag and environment variable for prism HParker (Adam Hess) via ruby-core
  2023-12-06  1:59 ` [ruby-core:115599] " HParker (Adam Hess) via ruby-core
  2023-12-06 12:59 ` [ruby-core:115606] " Eregon (Benoit Daloze) via ruby-core
@ 2023-12-06 13:40 ` eightbitraptor (Matthew Valentine-House) via ruby-core
  2023-12-06 20:57 ` [ruby-core:115611] " kddnewton (Kevin Newton) via ruby-core
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: eightbitraptor (Matthew Valentine-House) via ruby-core @ 2023-12-06 13:40 UTC (permalink / raw
  To: ruby-core; +Cc: eightbitraptor (Matthew Valentine-House)

Issue #20044 has been updated by eightbitraptor (Matthew Valentine-House).


Given the precedent set by `mjit` and `yjit` of having short names that mirror the actual project names my preferred approach is having `--prism` but labelling it as `(experimental)`

cf.

```
  --jit           enable JIT for the platform, same as --yjit
  --mjit          enable C compiler-based JIT compiler (experimental)
  --yjit          enable in-process JIT compiler
```

----------------------------------------
Bug #20044: Add runtime flag and environment variable for prism
https://bugs.ruby-lang.org/issues/20044#change-105539

* Author: HParker (Adam Hess)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled. 

The flags could be,

```
ruby --prism test.rb
```

and the environment variable could be,

```
RUBY_PRISM=1 ruby test.rb
```

Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen.

Things to be sure to discuss mentioned by @mame,

> * What to do with the command-line option when prism becomes the default parser in the future.
>  ** Just remove it, or leave it as a "do nothing" option?
> * What are the appropriate names.
> ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short.
> * Whether to print a warning when this mode is used.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:115611] [Ruby master Bug#20044] Add runtime flag and environment variable for prism
  2023-12-06  1:30 [ruby-core:115598] [Ruby master Bug#20044] Add runtime flag and environment variable for prism HParker (Adam Hess) via ruby-core
                   ` (2 preceding siblings ...)
  2023-12-06 13:40 ` [ruby-core:115608] " eightbitraptor (Matthew Valentine-House) via ruby-core
@ 2023-12-06 20:57 ` kddnewton (Kevin Newton) via ruby-core
  2023-12-07 10:33 ` [ruby-core:115642] " mame (Yusuke Endoh) via ruby-core
  2023-12-19  2:39 ` [ruby-core:115783] " mame (Yusuke Endoh) via ruby-core
  5 siblings, 0 replies; 7+ messages in thread
From: kddnewton (Kevin Newton) via ruby-core @ 2023-12-06 20:57 UTC (permalink / raw
  To: ruby-core; +Cc: kddnewton (Kevin Newton)

Issue #20044 has been updated by kddnewton (Kevin Newton).


I agree with marking it as experimental. This would only be for testing purposes (or maybe for an IDE for getting more enhanced error messages). That way (hopefully) there would not be an issue with removing it.

----------------------------------------
Bug #20044: Add runtime flag and environment variable for prism
https://bugs.ruby-lang.org/issues/20044#change-105542

* Author: HParker (Adam Hess)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled. 

The flags could be,

```
ruby --prism test.rb
```

and the environment variable could be,

```
RUBY_PRISM=1 ruby test.rb
```

Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen.

Things to be sure to discuss mentioned by @mame,

> * What to do with the command-line option when prism becomes the default parser in the future.
>  ** Just remove it, or leave it as a "do nothing" option?
> * What are the appropriate names.
> ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short.
> * Whether to print a warning when this mode is used.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:115642] [Ruby master Bug#20044] Add runtime flag and environment variable for prism
  2023-12-06  1:30 [ruby-core:115598] [Ruby master Bug#20044] Add runtime flag and environment variable for prism HParker (Adam Hess) via ruby-core
                   ` (3 preceding siblings ...)
  2023-12-06 20:57 ` [ruby-core:115611] " kddnewton (Kevin Newton) via ruby-core
@ 2023-12-07 10:33 ` mame (Yusuke Endoh) via ruby-core
  2023-12-19  2:39 ` [ruby-core:115783] " mame (Yusuke Endoh) via ruby-core
  5 siblings, 0 replies; 7+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2023-12-07 10:33 UTC (permalink / raw
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #20044 has been updated by mame (Yusuke Endoh).


Discussed at today's dev meeting. @matz said:

* Introduce a command-line option `--parser=prism` and `--parser=parse.y`
  * If parse.y is removed in the future, `--parser=parse.y` should report an error
* Do NOT introduce environment variable
  * Use `RUBYOPT=--parser=prism` instead
* No warning should be printed
* Add `+prism` (or `+PRISM` or something) to `RUBY_DESCRIPTION`, like YJIT
  * This should be removed in the future if prism is the default parser

```
$ ruby --jit --parser=prism -v
ruby 3.3.0dev (2023-12-07T02:37:08Z master 214f6d6598) +YJIT +prism [x86_64-linux]
```

----------------------------------------
Bug #20044: Add runtime flag and environment variable for prism
https://bugs.ruby-lang.org/issues/20044#change-105576

* Author: HParker (Adam Hess)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled. 

The flags could be,

```
ruby --prism test.rb
```

and the environment variable could be,

```
RUBY_PRISM=1 ruby test.rb
```

Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen.

Things to be sure to discuss mentioned by @mame,

> * What to do with the command-line option when prism becomes the default parser in the future.
>  ** Just remove it, or leave it as a "do nothing" option?
> * What are the appropriate names.
> ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short.
> * Whether to print a warning when this mode is used.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:115783] [Ruby master Bug#20044] Add runtime flag and environment variable for prism
  2023-12-06  1:30 [ruby-core:115598] [Ruby master Bug#20044] Add runtime flag and environment variable for prism HParker (Adam Hess) via ruby-core
                   ` (4 preceding siblings ...)
  2023-12-07 10:33 ` [ruby-core:115642] " mame (Yusuke Endoh) via ruby-core
@ 2023-12-19  2:39 ` mame (Yusuke Endoh) via ruby-core
  5 siblings, 0 replies; 7+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2023-12-19  2:39 UTC (permalink / raw
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #20044 has been updated by mame (Yusuke Endoh).


I noticed that the patch outputs a warning.

```
$ ./local/bin/ruby --parser=prism -e ''
./local/bin/ruby: warning: The compiler based on the Prism parser is currently experimental and compatibility with the compiler based on parse.y is not yet complete. Please report any issues you find on the `ruby/prism` issue tracker.
```

@matz said that it would be better *not* to output the warning. However, he also said that if you (the Prism developers) wanted to print it out, he would not stop the warning. FYI.

----------------------------------------
Bug #20044: Add runtime flag and environment variable for prism
https://bugs.ruby-lang.org/issues/20044#change-105719

* Author: HParker (Adam Hess)
* Status: Closed
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled. 

The flags could be,

```
ruby --prism test.rb
```

and the environment variable could be,

```
RUBY_PRISM=1 ruby test.rb
```

Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen.

Things to be sure to discuss mentioned by @mame,

> * What to do with the command-line option when prism becomes the default parser in the future.
>  ** Just remove it, or leave it as a "do nothing" option?
> * What are the appropriate names.
> ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short.
> * Whether to print a warning when this mode is used.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

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

end of thread, other threads:[~2023-12-19  2:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-06  1:30 [ruby-core:115598] [Ruby master Bug#20044] Add runtime flag and environment variable for prism HParker (Adam Hess) via ruby-core
2023-12-06  1:59 ` [ruby-core:115599] " HParker (Adam Hess) via ruby-core
2023-12-06 12:59 ` [ruby-core:115606] " Eregon (Benoit Daloze) via ruby-core
2023-12-06 13:40 ` [ruby-core:115608] " eightbitraptor (Matthew Valentine-House) via ruby-core
2023-12-06 20:57 ` [ruby-core:115611] " kddnewton (Kevin Newton) via ruby-core
2023-12-07 10:33 ` [ruby-core:115642] " mame (Yusuke Endoh) via ruby-core
2023-12-19  2:39 ` [ruby-core:115783] " mame (Yusuke Endoh) via ruby-core

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 read-only IMAP folder(s) and NNTP newsgroup(s).