@coolbutuseless@fosstodon.org
@coolbutuseless@fosstodon.org avatar

coolbutuseless

@coolbutuseless@fosstodon.org

Nerd.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Adventures in CRAN: Another CRAN rejection for {yyjsonr}.

CRAN is now reporting a clang-ASAN issue that I cannot reproduce with my clang-ASAN setup (using {rhub2})

Now what am I supposed to do?

Note: I have some line numbers related to the error, so I can do some digging.

But I can't do any testing to see if it's fixed. I have to use CRAN submission as my test runner.

Not something I want. And pretty sure they don't want it either.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

{remedy} AddIns -> AlignEqual()

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

I'm revisiting the problem of safe evaluation of untrusted R code.

That is: How could you easily run code from an untrusted source? How would you stop them from running "file.remove()" or worse?

I found the old shiny app I made to demo the idea.

Can you break out of the sandbox and make it run unsafe code? "rm()"? "file.remove()?

https://coolbutuseless.shinyapps.io/shiny-safe-eval/

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Work-in-progress: New JSON library

Early results on a microbenchmark look promising!

Fastest JSON parser for R?

Note: Benchmark is not be indicative of real-world use cases. Performance gap narrows on larger examples.

Output of code benchmarking new JSON parser. Results show new parser is faster than jsonlite and RcppSimdJson on this microbenchmark.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

TIL: someone once attempted refactoring R from C to C++

Project name: CXXR

https://www.cs.kent.ac.uk/projects/cxxr/

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Survey: what new bit of syntax would you like in base ?

What should the following bits of syntax do?

  • ===
  • ++ And --
  • +=
  • //
  • ?
  • {{ }}
  • [[[ ]]]
  • <<==
  • (?: X)
coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Free idea:

magic-wormhole package so a user can transfer data to/from other computers directly in an R session

https://github.com/magic-wormhole/magic-wormhole

coolbutuseless, to mastodon
@coolbutuseless@fosstodon.org avatar

Hivemind:

Is anyone interfacing R with hardware? Or know of packages which do?

Reading/writing from/to sensors?
Writing to LCD character displays?
LEGO Mindstorms?
Etc, etc ...

links/github/anything appreciated...

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

hivemind:

Does anyone actually use any type checking syntax hacks with their R code?

Do they even exist?

I'm thinking like methods similar to mypy or typescript - not just a bunch of explicit "stopifnot" checks at the start of a function.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Update v0.1.1 {callme} - a package for easily(?) compiling and loading C code into

  • Now windows compatible
  • DLL is now automatically unloaded

https://github.com/coolbutuseless/callme

image/png

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Interesting discovery: there are 4 types of special dates to match the 4 types of special numerics:

as.Date(NA)
as.Date(NaN)
as.Date(Inf)
as.Date(-Inf)

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

wish: Open the same file up in two panes so I can view different parts at the same time.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Update {yyjsonr} v0.1.1

Fastest(?) JSON/NDJSON parser for

  • Removed overhead when setting config options - now much faster for small JSON strings
  • Added from_json_raw() to parse json from raw bytes containing utf-8 chars

Benchmarks galore on github README.

  • 10x faster than jsonlite parsing 'iris' dataset from file.
  • 10x faster than jsonlite parsing 1000 rows of ndjson from file

Feedback welcomed as I figure out a roadmap to CRAN

https://github.com/coolbutuseless/yyjsonr

https://coolbutuseless.github.io/package/yyjsonr/index.html

Benchmark of yyjsonr package reading ndjson from file. yyjsonr shows speed advantage over other json packages for R

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Today I am pleased to annouce the c64-verse!

I trio of packages for c64 development in

  1. {c64vice} talks to a running VICE c64 emulator to send/receive info, cpu registers, memory dumps etc

  2. {c64asm} is a revamp of {r64}, a pure-R assembler for c64 6502 machine code - including syntax for including R data into code

  3. {c64tass} a wrapper for TASS - the de factor standard in c64 assemblers.

Logo for c64tass package. A hexagon with a Commodore computing logo in the centre.
Logo for c64asm package. A hexagon with a Commodore computing logo in the centre.
Logo for c64vice package. A hexagon with a Commodore computing logo in the centre.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

4.4.0 now includes "%||%" in base

I've always called it the "null operator", but I'm happy to learn of a better name.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

It has come to this:

All blog posts will now be R packages hosted on GitHub because I don't know if I have the patience to figure out how to upgrade my hugo/blogdown franken-blog to whatever the new hotness is (Quarto?) so I'll just make a new package and a README.Rmd for everything.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Anyone know of an package that shows fine-grained diffs between strings?

e.g. compare("abcdef", "abcedf")

Would print something like:

"abc🅳🅴f"

I hacked something together with adist() and ANSI (pictured), but would like a more robust solution :)

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Adventures with CRAN.

Adding tests and vignettes just seems to increase the exposed surface area for CRAN checks.

If I want a better chance of getting my pkg on CRAN, I should just never add tests?

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

I spend more time fixing issues with GitHub Actions for my R packages than actually enjoying the benefit they're supposed to offer.

Every time I come back to an older project something is broken in the GitHub Actions config due to the R {actions} package changing.

hot take

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

gurus: does anyone know how to define a new chunk type?

e.g. say I wanted a cobol chunk

How can I

  • define handling the code in the chunk?
  • Access/handle the chunk options?
  • capture and return output for the final document

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

hypothetical: what would happen if I

  • manually allocated some memory in C (with malloc)
  • Crafted the memory to be an R object by writing a proper SEXP header for it
  • Returned this to R

Would R consider this cuckoo object to be real? It wouldn't appear in the list of objects to be garbage collected - would that impact its validity?

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Today's puzzle:

x = list(apple = 1, 8ball = 2)

How do you get R to properly autocomplete the name '8ball' when typing:

x$8<TAB>

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

hivemind:

What's the current preferred solution for running multiple R versions on macOS?

rig?
rswitch?

something else?

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Help needed!

I want to email R-devel & get clarification on "Can we create custom connections in packages?"

I find the situation confusing because using the "Connections.h" is mentioned in R-exts manual - and so formally(?) part of the API

But this conflicts with the NOTE generated if you try to use "R_new_custom_connection()" which says it is "non-API"

Am I tilting at windmills? Poking the bear? HELP!

Edits/suggestions welcomed in the gist below.

https://gist.github.com/coolbutuseless/2b261e2f7f54206c1263fbca0e71ac64

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Is there a blessed way to create a RAWSXP from an existing chunk of memory within C?

Specifics:

  • The memory is already allocated elsewhere
  • I don't want to use memcpy, just wrap the memory where it is such that the RAWSXP points to it.
  • I don't want the garbage collector to know about it - I will free the memory myself later.
  • It still has to be valid RAWSXP that I can use in R

This is a bit of a callback to this post: https://fosstodon.org/@coolbutuseless/111956983679205597

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • ngwrru68w68
  • kavyap
  • everett
  • Durango
  • osvaldo12
  • rosin
  • thenastyranch
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • InstantRegret
  • Youngstown
  • slotface
  • JUstTest
  • anitta
  • normalnudes
  • ethstaker
  • cisconetworking
  • tacticalgear
  • khanakhh
  • cubers
  • GTA5RPClips
  • provamag3
  • modclub
  • Leos
  • tester
  • lostlight
  • All magazines