Traditionally, Glimmer GUI gems have been mostly a one-sided effort. Well,
that changes with Glimte! Glimte is a 3rd party framework built on top of
Glimmer (Tk flavor) by Phaengris to facilitate following a certain flavor
of the MVC pattern (Model-View-Controller) called MVVM
(Model-View-ViewModel). It encourages a model of programming for desktop
GUI views that is similar to Rails .erb
https://andymaleh.blogspot.com/2023/01/glimmer-ecosystem-glimte-passwordsto…
Hi,
I just evaluated the possibility of using Ractors to distribute
processing using various gems with native extensions (some matrix/vector
computations with Numo::Linalg and approximate vector searches) and I've
mixed feelings.
The Ractor design seems very sound to me and I would prefer to use them
to distribute the load on multiple CPUs but in practice I see 2 major
obstacles :
- the first use of Ractor code isn't encouraging, even with Ruby 3.2.0,
as it outputs :
"warning: Ractor is experimental, and the behavior may change in future
versions of Ruby! Also there are many implementation issues."
- when heavy computations are involved you are probably already using
gems with native extensions and when trying to use them in a non-main
Ractor you will almost always get an exception :
"ractor unsafe method called from not main ractor (Ractor::UnsafeError)"
This last problem could be manageable, according to :
https://bugs.ruby-lang.org/issues/17307
native extensions should mark their individual functions as thread safe
using :
#ifdef HAVE_RB_EXT_RACTOR_SAFE
rb_ext_ractor_safe(true);
#endif
I was considering contacting the maintainers of the various gems that we
use to check with them which methods are safe and to see if I can submit
a pull request but I'm a bit hesitant and wonders if Ractors are
actually used and stable enough for maintainers to care.
Do people on this list use Ractors? What for?
Do people code gems with native extensions with them in mind? I've seen
traces of rb_ext_ractor_safe when searching on Github but almost all of
the matches are from load.h from the Ruby headers but not many actual
uses (in the 4 first pages of results Psych and TruffleRuby are the only
exceptions and the first external gem is ruby-extlz4 on the 5th page...).
I've yet to see how the ffi gem can handle Ractors, I already know
there's no trace of Ractors in its code and this could be a complete new
can of worms (or not...).
I'll dig a bit more but in my current position I think I'll favor a
multi-process solution to scale (mostly because I don't have a
definitive list of gems I'll have to patch at this point and time is
short). That's a shame and I'm willing to revisit this later.
Best regards,
Lionel
cel 0.2.0 has been released.
https://gitlab.com/honeyryderchuck/cel-ruby
Pure Ruby implementation of Google Common Expression Language,
https://opensource.google/projects/cel.
> The Common Expression Language (CEL) implements common semantics for
expression evaluation, enabling different applications to more easily
interoperate.
```
env = Cel::Environment.new(name: :string, group: :string)
ast = env.compile('name.startsWith("/groups/" + group)')
prg = env.program(ast)
return_value = prg.evaluate(name: Cel::String.new("/groups/
acme.co/documents/secret-stuff"),
group: Cel::String.new("acme.co")))
puts return_value #=> true
```
These are the announcements since the last release:
## [0.2.0] - 2023-01-17
### Features
#### Timestamp/Duration types
Implementing `Cel::Timestamp` and `Cel::Duration` CEL types, along with
support for functions for those types (such as `getDate`, `getDayOfYear`).
```ruby
Cel::Environment.new.evaluate("timestamp('2022-12-25T00:00:00Z').getDate()")
#=> 25
Cel::Environment.new.evaluate("duration('3600s10ms').getHours()") #=> 1
```
#### Protobuf-to-CEL conversion
Support for auto-conversion of certain protobuf messages in the
`google.protobf` package to CEL types.
https://github.com/google/cel-spec/blob/master/doc/langdef.md#dynamic-values
```ruby
Cel::Environment.new.evaluate("google.protobuf.BoolValue{value: true}") #=>
true
Cel::Environment.new.evaluate("google.protobuf.Value{string_value: 'bla'}")
#=> "bla"
```
#### Custom Functions
`cel` supports the definition of custom functions in the environment, to be
used in expressions:
```ruby
Cel::Environment.new(foo: Cel::Function(:int, :int, return_type: :int) {
|a, b| a + b }).evaluate("foo(2, 2)") #=> 4
```
### Expression encoding/decoding
Expressions can now be encoded and decoded, to improve storage / reparsing
to and from JSON, for example.
```ruby
enc = Cel::Environment.new.encode("1 == 2") #=> ["op", ...
store_to_db(JSON.dump(enc))
# then, somewhere else
env = Cel::Environment.new
ast = env.decode(JSON.parse(read_from_db))
env.evaluate(ast) #=> 3
```
**NOTE**: This feature is only available in ruby 3.1 .
### Bugfixes
* fixed parser bug disallowing identifiers composed "true" or "false" (such
as "true_name").
## [0.1.2] - 2022-11-10
point release to update links in rubygems.
## [0.1.1] - 2022-08-11
* fixed handling of comparison of primmitive types with Cel types.
* fixed truffleruby compatibility by improving parser number handling.
Glimmer DSL for LibUI 0.6.1 has been released with support for table lazy
loading via `Enumerator` (or `Enumerator::Lazy`). As a result, the table
control can now handle millions of rows and renders instantly without
waiting for all data to be loaded given that it is loaded lazily as the
user scrolls through the table. That enables applications with a lot of
data to start instantly. A new example, Lazy Table, has been included to
demonstrate table lazy loading.
RubyGem: https://rubygems.org/gems/glimmer-dsl-libui
GitHub: https://github.com/AndyObtiva/glimmer-dsl-libui
Blog announacement:
https://andymaleh.blogspot.com/2023/01/glimmer-dsl-for-libui-table-lazy-loa…
Change Log:
0.6.1
- `examples/lazy_table.rb` (4 versions) table lazy loading with a million
rows via `Enumerator` or `Enumerator::Lazy` to enable instant app startup
time
- Support `table` `cell_rows` implicit data-binding to a collection of
models (only supported an array of arrays before in implicit data-binding)
0.6.0
- Upgrade to `libui` Ruby gem version 0.1.0.pre.0, which includes a newer C
libui alpha release (libui-ng Nov 13, 2022)
- Support table `cell_rows` `Enumerator` or `Enumerator::Lazy` value to do
lazy loading of data upon display of rows instead of immediate loading of
all table data, thus improving performance of table initial render for very
large datasets
- Fix issue with `table` `progress_bar_column` not getting updated
successfully on Windows if there were dual or triple columns before it.
- Fix issue with `table` `progress_bar_column` not getting updated
successfully on Windows if data-binding table to an array of models instead
of an array of arrays
- Fix issue with `table` `checkbox_column` checkbox editing not working in
Mac by including a new C libui-ng release
- Fix issue with `table` `checkbox_text_column` checkbox editing not
working in Mac or Windows by including a new C libui-ng release
- Update examples/basic_table_checkbox.rb to enable editing checkbox values
- Update examples/basic_table_checkbox_text.rb to enable editing
checkbox/text values
- [final] Optimize `table` scrolling performance when having many rows and
columns (prevent recalculation of `expanded_cell_rows` on every cell
evaluation). Resolve:
https://github.com/AndyObtiva/glimmer-dsl-libui/issues/38
- [final] `refined_table` `pagination: false` option to disable pagination,
but keep filtering.
- [final] Fix issue with `Glimmer::LibUI::interpret_color` support for `[r,
g, b, a]` `Array`-based colors, returning `[r, g, b]` only without alpha
value
- [final] Fix issue "Cannot add rows to a table that started empty":
https://github.com/AndyObtiva/glimmer-dsl-libui/issues/36
- [final] `window` `#open` method as alias to `#show`
- [final] `window` `#focused?` read-only property
- [final] Document `window` `on_focus_changed` listener
- [final] Update `examples/basic_child_window.rb` to demo
`on_focus_changed` and `focused?`
- [final] `open_folder` support
- [final] examples/control_gallery.rb now includes an "Open Folder" File
menu item
imap_processor version 1.8.0 has been released!
* home: <https://github.com/seattlerb/imap_processor>
* rdoc: <http://docs.seattlerb.org/imap_processor>
IMAPProcessor is a client for processing messages on an IMAP server. It
provides some basic mechanisms for connecting to an IMAP server, determining
capabilities and handling messages.
IMAPProcessor ships with several executables which can query and
manipulate IMAP mailboxes in several different ways:
imap_archive :: Archives old messages to a new dated mailbox.
imap_cleanse :: Delete messages older than a certain age in specified mailboxes.
imap_flag :: Flag messages to/from certain people.
imap_idle :: Shows new messages in a mailbox.
imap_keywords :: Queries an IMAP server for keywords set on messages
imap_learn :: Flags messages based on what you've flagged before.
imap_mkdir :: Ensures that certain mailboxes exist.
Changes:
### 1.8.0 / 2023-01-09
* 1 major enhancement:
* Added imap_tidy, a hybrid between cleanse and archive.
* 1 minor enhancement:
* Added Time.imapdate(s), Time.imapdatetime(s), and #yyyy_mm.
* 2 bug fixes:
* Fixes for net/imap changes in ruby 3.x.
* Removed unused last_month from IMAPProcessor::Archive
Recently, I received a support request concerning Glimmer DSL for SWT
(JRuby Desktop Development GUI Framework) and the use of Nebula Custom
Widgets, specifically the text_assist widget (auto-complete text field).
For a quick background about Nebula, it is a collection of 55+
enterprise-grade high-quality SWT (Standard Widget Toolkit) custom widgets,
including a progress circle, a password revealer, and an oscilloscope.
Thanks to Glimmer DSL for SWT, they are usable from Ruby.
https://andymaleh.blogspot.com/2023/01/using-nebula-textassist-from-glimmer…
minitest version 5.17.0 has been released!
* home: <https://github.com/seattlerb/minitest>
* bugs: <https://github.com/seattlerb/minitest/issues>
* rdoc: <https://docs.seattlerb.org/minitest>
* vim: <https://github.com/sunaku/vim-ruby-minitest>
* emacs: <https://github.com/arthurnn/minitest-emacs>
minitest provides a complete suite of testing facilities supporting
TDD, BDD, mocking, and benchmarking.
"I had a class with Jim Weirich on testing last week and we were
allowed to choose our testing frameworks. Kirk Haines and I were
paired up and we cracked open the code for a few test
frameworks...
I MUST say that minitest is *very* readable / understandable
compared to the 'other two' options we looked at. Nicely done and
thank you for helping us keep our mental sanity."
-- Wayne E. Seguin
minitest/test is a small and incredibly fast unit testing framework.
It provides a rich set of assertions to make your tests clean and
readable.
minitest/spec is a functionally complete spec engine. It hooks onto
minitest/test and seamlessly bridges test assertions over to spec
expectations.
minitest/benchmark is an awesome way to assert the performance of your
algorithms in a repeatable manner. Now you can assert that your newb
co-worker doesn't replace your linear algorithm with an exponential
one!
minitest/mock by Steven Baker, is a beautifully tiny mock (and stub)
object framework.
minitest/pride shows pride in testing and adds coloring to your test
output. I guess it is an example of how to write IO pipes too. :P
minitest/test is meant to have a clean implementation for language
implementors that need a minimal set of methods to bootstrap a working
test suite. For example, there is no magic involved for test-case
discovery.
"Again, I can't praise enough the idea of a testing/specing
framework that I can actually read in full in one sitting!"
-- Piotr Szotkowski
Comparing to rspec:
rspec is a testing DSL. minitest is ruby.
-- Adam Hawkins, "Bow Before MiniTest"
minitest doesn't reinvent anything that ruby already provides, like:
classes, modules, inheritance, methods. This means you only have to
learn ruby to use minitest and all of your regular OO practices like
extract-method refactorings still apply.
Changes:
### 5.17.0 / 2022-12-31
* 1 minor enhancement:
* Refactor setup hooks into a SETUP_METHODS constant. (MSP-Greg)
* 3 bug fixes:
* Fix kwargs for Mock calls to delegator. (blowmage)
* Fix kwargs for expectations. (bobmazanec, blowmage)
* Remove check for .b method. (tenderlove)