Replies

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

lorentey, to random
@lorentey@mastodon.social avatar

A wild Swift evolution pitch appears! It overhauls some fundamental Standard Library constructs to allow building things using noncopyable types. It's super effective, I hope

https://forums.swift.org/t/pitch-noncopyable-standard-library-primitives/71566

lorentey,
@lorentey@mastodon.social avatar

What? PITCH is evolving!
✨💫✨
Congratulations! Your PITCH evolved into PROPOSAL!

SE-0437: Generalizing standard library primitives for non-copyable types

https://forums.swift.org/t/se-0437-generalizing-standard-library-primitives-for-non-copyable-types/72020

ctietze, to random
@ctietze@mastodon.social avatar

@lorentey I read your 2021 forum post that a mutable SortedArray would be impractical after ~2000 items
https://forums.swift.org/t/add-sortedarray-sortedset-and-sorteddictionary-with-binary-search/47303/2

Is that because of resizing the array or the search that is required to look for a fitting index, or both?

Do you have benchmark code lying around by chance?

lorentey,
@lorentey@mastodon.social avatar

@ctietze This is primarily because insertions and removals have complexity that’s linear in the size of the array — they have to slide existing items to make room for a new one or to close gaps after a removal.

Arrays have benefits on small sizes because they are compact. Beyond a couple thousands or so items, this advantage is entirely eclipsed by all these movement costs: they become unbearably slow.
[1/2]

lorentey, to random
@lorentey@mastodon.social avatar

Current status: sinking back into electronics to teach 3d printed things to move. It’s a hobbyception!

lorentey,
@lorentey@mastodon.social avatar

It’s alive! 👨🏼‍🔬🔬🔭

video/mp4

lorentey,
@lorentey@mastodon.social avatar

Cleaning up the rat’s nest at the back will be a nice project for another day

video/mp4

lorentey,
@lorentey@mastodon.social avatar

@schwa Not that much — IIRC about 4 days for the four digits! Lots of 2-hour prints, with a few 5-6 hour long ones sprinkled in

krzyzanowskim, to random
@krzyzanowskim@mastodon.social avatar

deleted_by_author

  • Loading...
  • lorentey,
    @lorentey@mastodon.social avatar
    ctietze, to random
    @ctietze@mastodon.social avatar

    Anyone else still mad at 's index(_:offsetBy:limitedBy:) being so cumbersome to use with endIndex? 🤚

    lorentey,
    @lorentey@mastodon.social avatar

    @ctietze that but mostly the fact that it fails to indicate just how many steps it did manage to take 😞

    nicklockwood, to random
    @nicklockwood@mastodon.social avatar

    tip: if you need to bind a non-optional value to a temporary variable inside a conditional statement, you can use case let, e.g:

    if indexPath.section < sections.count,
    case let section = sections[indexPath.section],
    indexPath.row < section.rows.count,
    case let row = section.rows[indexPath.row],
    row.isEnabled
    {
    ...
    }

    This saves you needing to split up the condition into multiple statements, and polluting the local namespace with temporary variables you don't need again.

    lorentey,
    @lorentey@mastodon.social avatar

    @ctietze @nicklockwood Just popping in to note that there is only one String.Index type, shared across all string views. (The indexing model would in fact be simpler to understand/implement if each view had its own index type, but that was deemed too inconvenient. Nevertheless, creating named wrapper types to implement ad hoc subtypes is a highly useful technique, and it should be encouraged and normalized, rather than ridiculed.)

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