[#112638] [Ruby master Bug#19470] Frequent small range-reads from and then writes to a large array are very slow — "giner (Stanislav German-Evtushenko) via ruby-core" <ruby-core@...>

Issue #19470 has been reported by giner (Stanislav German-Evtushenko).

8 messages 2023/03/01

[#112664] [Ruby master Bug#19473] can't be called from trap context (ThreadError) is too limiting — "Eregon (Benoit Daloze) via ruby-core" <ruby-core@...>

Issue #19473 has been reported by Eregon (Benoit Daloze).

28 messages 2023/03/02

[#112681] [Ruby master Misc#19475] Propose Matthew Valentine-House (@eightbitraptor) as a core committer — "k0kubun (Takashi Kokubun) via ruby-core" <ruby-core@...>

SXNzdWUgIzE5NDc1IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGswa3VidW4gKFRha2FzaGkgS29rdWJ1

11 messages 2023/03/03

[#112744] [Ruby master Bug#19485] Unexpected behavior in squiggly heredocs — "jemmai (Jemma Issroff) via ruby-core" <ruby-core@...>

Issue #19485 has been reported by jemmai (Jemma Issroff).

9 messages 2023/03/08

[#112746] [Ruby master Bug#19518] Recent Source Releases Do Not Compile on CentOS 7 Due to configure Script Error Generated By autoconf >= 2.70 — "eviljoel (evil joel) via ruby-core" <ruby-core@...>

Issue #19518 has been reported by eviljoel (evil joel).

7 messages 2023/03/08

[#112770] [Ruby master Feature#19520] Support for `Module.new(name)` and `Class.new(superclass, name)`. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19520 has been reported by ioquatix (Samuel Williams).

42 messages 2023/03/09

[#112773] [Ruby master Feature#19521] Support for `Module#name=` and `Class#name=`. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19521 has been reported by ioquatix (Samuel Williams).

31 messages 2023/03/09

[#112818] [Ruby master Misc#19525] DevMeeting-2023-04-13 — "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>

Issue #19525 has been reported by mame (Yusuke Endoh).

8 messages 2023/03/10

[#112871] [Ruby master Bug#19529] [BUG] ObjectSpace::WeakMap can segfault after compaction — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #19529 has been reported by byroot (Jean Boussier).

12 messages 2023/03/14

[#112926] [Ruby master Misc#19535] Instance variables order is unpredictable on objects with `OBJ_TOO_COMPLEX_SHAPE_ID` — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #19535 has been reported by byroot (Jean Boussier).

8 messages 2023/03/17

[#112933] [Ruby master Feature#19538] Performance warnings — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #19538 has been reported by byroot (Jean Boussier).

11 messages 2023/03/17

[#112944] [Ruby master Feature#19541] Proposal: Generate frame unwinding info for YJIT code — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>

SXNzdWUgIzE5NTQxIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu

13 messages 2023/03/19

[#113033] [Ruby master Feature#19555] Allow passing default options to `Data.define` — "p8 (Petrik de Heus) via ruby-core" <ruby-core@...>

Issue #19555 has been reported by p8 (Petrik de Heus).

7 messages 2023/03/28

[#113045] [Ruby master Feature#19559] Introduce `Symbol#+@` and `Symbol#-@`, and eventually replace boolean arguments with symbols — "sawa (Tsuyoshi Sawada) via ruby-core" <ruby-core@...>

Issue #19559 has been reported by sawa (Tsuyoshi Sawada).

20 messages 2023/03/30

[#113059] [Ruby master Bug#19563] Ripper.tokenize(code).join != code when heredoc and multiline %w[] literal is on the same line — "tompng (tomoya ishida) via ruby-core" <ruby-core@...>

Issue #19563 has been reported by tompng (tomoya ishida).

6 messages 2023/03/31

[ruby-core:112717] [Ruby master Feature#19452] `Thread::Backtrace::Location` should have column information if possible.

From: "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date: 2023-03-07 11:22:13 UTC
List: ruby-core #112717
Issue #19452 has been updated by mame (Yusuke Endoh).


@ioquatix Please, please write a use case in every proposal.

First of all, I think the POC itself is very naive for daily use. Consider the following method call. For Thread::Bactrace::Location of the call to foo, `#first_column` will point before the receiver, not before the method name. And `#last_column` will point after all arguments.

```
  very_very_long_receiver.foo(many_many_arguments)
  ^                                               ^
  |                                               |
  +--- #first_column             #last_columns ---+
```

Without a use case, it would be impossible to discuss whether and how it is useful. This is a heavier feature than you might think to introduce for the sake of "better than nothing".

---

`ErrorHighlight.spot` is a bit more intelligent: it cuts out the method name part.

```
  very_very_long_receiver.foo(many_many_arguments)
                         ^^^^
                           |
                           +--- ErrorHighlight.spot
```

To achieve this, ErrorHighlight uses `RubyVM::AST.of`: it reparses the source code, identify the node in the method call, and draw an underline after its receiver and before its arguments.

Because of using `RubyVM::AST.of`, ErrorHighlight works only with CRuby. That is unfortunate. Currently @kddeisz is working on a new Ruby parser project called [yarp](https://github.com/Shopify/yarp). As far as I know, its goal is to be a common parser for all major Ruby implementations including CRuby and TruffleRuby. If the goal is accomplished, I will use yarp for ErrorHighlight, which will (hopefully) allow ErrorHighlight to work on Ruby interpreters rather than CRuby.

Even in that case, it is still necessary to map `Thread::Backtrace::Location` to the AST node. We may use `Thread::Backtrace::Location#first_lineno`, etc. to identify the AST node corresponding to the `Thread::Backtrace::Location`. But this should be considered after yarp actually becomes a CRuby parser. (Implementation note: currently, `Thread::Backtrace::Location` has the ID of the AST node, which is a number assigned internally to the nodes in the AST in (approximate) pre-order. `RubyVM::AST.of` re-parses the source code to recover the full AST, and then identifies the AST node by using the node ID. This is the method suggested by @ko1. The four values, first_lineno / first_column / last_lineno / last_column, could be another way to identify nodes. But this is slightly less accurate: if there is another node in the exact same code range, it is not uniquely identifiable. I don't think this is a problem for ErrorHighlight, though.)

@eregon @kddeisz Any opinions?

----------------------------------------
Feature #19452: `Thread::Backtrace::Location` should have column information if possible.
https://bugs.ruby-lang.org/issues/19452#change-102173

* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
----------------------------------------
I discussed this with @mame and it would be pretty useful if we could also get the column information from exception backtrace location, even if it was slow.

A POC:

```ruby
class Thread::Backtrace::Location
  if defined?(RubyVM::AbstractSyntaxTree)
    def first_column
      RubyVM::AbstractSyntaxTree.of(self, keep_script_lines: true).first_column
    end
  else
    def first_column
      raise NotImplementedError
    end
  end
end
```

It would be good to have a standard interface, so we follow the same interface as https://bugs.ruby-lang.org/issues/19451 and vice versa where it makes sense. I'll investigate it.



-- 
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/

In This Thread