Discover and read the best of Twitter Threads about #rustlang

Most recents (24)

1/ There's a lot of edge in building a production crypto HFT system the right way.

The abstractions should be rich enough to prevent careless mistakes but not too rigid to work with.

I converged on these after countless hours of building, debugging, and rewriting code 🧵
2/ Let's focus on a concrete example: How do you deal with continuous quantities?

Doing math in code with raw numeric types is error prone. Multiplying the price of one symbol by the size of another is sure way to blow up your strategy.

Just be careful? Nah, we can do better.
3/ A pervasive feature of our trading system is the concept of "units."

The first idea is to have separate types for Price, Size, Notional, etc.

Define relations:
Price * Size = Notional
Size + Size = Size
etc.

But Size * Size? Nonsensical, and now you get a compiler error.
Read 12 tweets
Shamelessly stealing an idea from @jacksonfall and prompting GPT-4 to help me build a profitable business.

I'm going to start with the same prompt and do whatever it asks me to.

Let's goooooooo

Alright so the approach here is to find a product or service with high demand and low supply using a website like @junglescout or @GoogleTrends

On Google trends, the term "chat GPT" is exploding in popularity so I asked HustleGPT to suggest products related to that.

#gpt4 Image
@junglescout @GoogleTrends Top ideas generated by the bot 🤖

- AI-related books
- Ergonomic keyboards
- High-quality microphones
- Webcams

It also suggested digital products and I liked that more so I asked it to elaborate.

The answer? Chat bot scripts. That sounds easy enough 😅 Image
Read 33 tweets
This weekend, I upgraded our game engine's renderer to support PBR — check out how big of a difference it is!

This is a thread full of the steps (and missteps) I took along the way.

#rustlang #gamedev The classic "Damaged Helmet" PBR asset distributedThe classic "Damaged Helmet" PBR asset distributed
Most of the techniques I implemented this weekend came from the Filament PBR docs: google.github.io/filament/Filam…
as well as from Hotham (github.com/leetvr/hotham), a game engine built by my friend @Kane_rogers!
The first thing we had to do was get all of the PBR material information into the engine and start sampling it in our shaders.

Adam, the test character we've been using, is not designed for PBR and the new material parameters are NOT hooked up right. He looks worse than before! A balding guy in a poorly lit environment wearing a suspicio
Read 16 tweets
#programming with a fellow #dev can be more productive than you can envision!
medium.com/p/528d555f7846
#Containers provide an unparallel lift for #AI and #MachineLearning
medium.com/p/37675980b4d
Read 12 tweets
#rustlang #programming
I wanna talk about some traits in std::convert and std::ops packages about Rust which contains some features about implicitly conversion like reference and structs.
Follow me to catch up updates.
The first operator pair need to be talk is std::convert::{From, Into} which you may heard or used it. All is ok, I will show you what it is and how to use it well.
From trait is the most common things that you will use it Rust lang, like String::from() which you use all day.
Tips 1: From trait is reflexive, which means that String::from(String) is implemented naturally.
Tip 2: If you impl a From trait for some struct, Into trait has been implmented by compiler
Read 5 tweets
livedraw is the framework part in this diagram. You have the code dealing with the state, the UI, the rust library and the python axidraw daemon.

Artists are free to use it – ideally with a different UI (I need to introduce a skin system in the future to different from mine) Image
not yet fully documented because it's just the beginning 🙂
Read 6 tweets
🆕🦀 Just an hour ago, #rustlang 1.66.0 was released!

As usual, here's a thread with some of the highlights. 🧵

1/12
Rust 1.66 comes with std::hint::black_box(), a function that does nothing. However, the compiler tries its very best to pretend it doesn't know what it does.

It is useful in benchmarks, to prevent the compiler from optimizing your entire benchmark away.

2/12 use std::hint::black_box; use std::sync::atomic::{AtomicU64,
The Option type got a new method: Option::unzip(). It's basically the opposite of Option::zip(): it splits an Option of a pair into a pair of Options.

3/12 impl<T, U> Option<(T, U)>  pub fn unzip(self) -> (Option<T>,
Read 12 tweets
#egui and eframe 0.20.0 released!

AccessKit support, prettier text, overlapping widget, and much more!

Try it at egui.rs

This is a BIG release, so let me list some highlights (1/n)

#rustlang #wasm #gamedev
Matt Campbell added support for AccessKit to egui and eframe. This vastly improves the accessibility of eframe apps on Windows and Mac! Read more about AccessKit: github.com/AccessKit/acce…
A lot of the recent egui development have been driven by our work at Rerun.io, including vastly improved Tables (found in egui_extras)
Read 13 tweets
So why do I think #Scrypto will ultimately take over the #rustlang #smartcontract race? Here are my thoughts 🧵
1. Non Fungible and Fungible resources are known first hand by the engine and #scrypto. This is HUGE. You dont need to design behaviors of mint, burn, transfer. They are NOT contracts. These are RESOURCES. This is TRUE native asset first #smartcontract
2. Authorization is built in as a concept and comes in 2 forms. These are simply Fungible/Non Fungible resources. These resources can be used as a form of authorization. In #scrypto, we call them a Proof. Why do we need them? Direct mapping of address => some data is UNSAFE
Read 8 tweets
For my #NFT #DeFi #rustlang #scrypto challenge, I've created a #decentralized freelance platform! Here are my learnings from them all!🧵👇
github.com/radixdlt/scryp…
1. For authorization, its okay to use one badge for multiple components. You can think of authorization as a login to a service/platform you have in real life. Unless you have another whole service, just use one badge!
2. When creating protected methods, its also okay to use admin rights for components to store. This gives the flexibility that the component is able to call other component methods as well as an admin user (should you want to ofc)
Read 7 tweets
1/9 We are excited to share what we’ve been cooking for the #NEAR Developer Governance in the past few months.

It became obvious to us that to build a decentralized developer ecosystem, we need to be maximally open and flexible, while ensuring quality and failure resistance.
2/9 We are lucky to have devs in #NEAR who were directly involved in similar orgs like #rustlang . Our solution is Developer Governance, which combines Community Groups and Work Groups to achieve both quality and flexibility, with a DAO committee deciding on asset distribution.
3/9 Community Groups (CG) are specialized self-organized communities. Today we have Protocol, Wallets, Indexer, and UA CGs with up to 100 ppl each. Anyone can create a CG, choose a format, and invite others. The goal is to come up with ideas and concerns for the Work Groups.
Read 9 tweets
It’s hard to overstate the importance of refactoring your code. When done right, refactoring can reduce complexity and make your code more readable and easier to maintain.

In this thread 🧵 we'll show you some nifty refactorings in IntelliJ Rust.

👉 plugins.jetbrains.com/plugin/8182-ru…
The most important shortcut for working with refactorings in JetBrains IDEs is ⌃T, or Ctrl+Alt+Shift+T for Windows/Linux. It brings up the ‘Refactor this’ menu where you can simply choose the refactoring you need from the list.

plugins.jetbrains.com/plugin/8182-ru… #rustlang Image
One of the most frequently used refactorings is ‘Rename’. It renames any symbol and automatically corrects all its references in your code. Just place the caret on a symbol and press ⇧F6 / Shift+F6 to begin renaming.

plugins.jetbrains.com/plugin/8182-ru… #rustlang
Read 7 tweets
Today is a big day @InfluxDB. We're announcing the release of InfluxDB IOx, the new core of the database written in #rustlang and built with @ApacheArrow. It delivers infinite cardinality, tiered data storage, SQL compatibility and so much more. Here's some of the background...
When we released #InfluxDB 1.0 in 2016, it was written in #golang and had a custom storage engine we built from scratch that was specifically optimized for metrics workloads. We called it the Time Structured Merge Tree (or TSM for short).
The design of TSM paired a time series storage database with an inverted index to map metadata to underlying time series. This delivered excellent performance for low to medium cardinality workloads. But as the precision of information in the metadata increased, the DB suffered.
Read 9 tweets
Interested in public transit 🚌🚅⛴️ data and software development? Check out the gtfs_manager project, a prototype desktop application written in #rustlang by @maxunsted, to explore and even edit your GTFS files 🎉 A short thread... Image
The project is now at MVP prototype stage and is looking for people to test it out, provide feedback, and get involved. See post on @rustlang Reddit here: reddit.com/r/rust/comment… for details.
The code underlying the project is #OpenSource and can be found on @github. It's in many ways a @foss4g + #gischat project but focus is on user experience. Check the video there + install with:
cargo install --git github.com/spstreets/gtfs…
Read 5 tweets
cargo-semver-checks 0.7.0 has some new checks:
📤 `pub use` re-exports
⚡ auto-trait impls (Sync, Sized, ...)
🔃 impl of derived traits

No more #rustlang auto-trait regressions! 💯 Add an Rc<T> field — oops, your type isn't Send/Sync anymore. So easy to miss, but not anymore. cargo-semver-checks run rep...cargo-semver-checks run rep...
A few months ago, @nikomatsakis wondered on his blog if we could have a simple GitHub Action that would warn about semver regressions.

That GitHub Action is here:
- uses: obi1kenobi/cargo-semver-checks-action@v1

smallcultfollowing.com/babysteps/blog… Side note that, no matter w...
Semver accidents happen. cargo-semver-checks saved me from one just two days ago. clap v3.2.6 had one a few months ago due to auto-traits:
github.com/clap-rs/clap/i…

cargo-semver-checks could have prevented the clap accident too, if it had existed at the time. cargo-semver-checks finds t...
Read 4 tweets
Hot-reload for #rustlang just got better. Thanks to plenty of feedback I released v0.5 of github.com/rksm/hot-lib-r…. It adds a new mechanism for defining hot-reloadable code that reduces boilerplate considerably.
The #[hot_module] attribute macro now provides a way to create a module that is 1:1 replaceable with a static version. The wrapped functions from the library are automatically reloaded when the library changes. No more manual updates. Here is how a simple example looks like:
Also the documentation was rewritten and extended. Check it out here: docs.rs/hot-lib-reload…. The hot-lib-reloader repository also has more examples now.
Read 5 tweets
In my tiny building game, I want your creations to exist in a world that feels alive. As a first step, I tackled ivy 🌿 As time passes, ivy grows on walls, bringing a bit of life with it✨

Brief tech overview in the🧵

#screenshotsaturday #indiegamedev #rustlang 🦀 #bevyengine
A new system needs to interact with all the previous systems. Finding a suitable algorithm took me a few iterations 👀💦

Ivy needs to know if a wall gets changed...
... or if a wall gets erased. (either via the player's input or by the undo system)
Read 11 tweets
This month I finally convinced myself to tackle the undo-redo system since it was becoming a premonition of a technical debt👀

And of course I decided to make it animated. How hard can it be, right!? 😂 [1/10]

#screenshotsaturday #indiegamedev #rustlang 🦀 #procgen #bevyengine
[2/10] Undo is essential for this game to stay playful and relaxing: if you misclick, a cat jumps on the keyboard, or you simply change your mind, it should always be easy to go back.

I had been scheming an undo system for a while, and now was the time to roll up my sleeves 💪
[3/10] Undo-redo for terrain and paths was pretty straightforward. Since the interactions between systems are procedural, a lot of animation is happening for free 😎 For ex, arches appearing where paths cross walls, stones arranging along a path, or walls sticking to the ground
Read 10 tweets
Lies we tell ourselves to keep using Golang

fasterthanli.me/articles/lies-…
Walter Bright (D language) defending operator overloading in the comments In repsonse to "operator overloading is the spawn of Sa
Read 41 tweets
1/ Is #Solana going down to a hole?

Let's look at the causes of the Wormhole hack and what we can learn from this.

Let's discuss Solana security.

A thread.

👇👇👇
2/ One of Solana's bridges, Wormhole, got hacked for ~120k ETH earlier this week.

coindesk.com/markets/2022/0…

The amount of US dollar value at risk, or lost, at this point, is $200-300M.
3/ A bridge is a blockchain application that bridges value between two blockchains together.

In this case, Wormhole was bridging ETH from Ethereum Mainnet to Solana.
Read 34 tweets
🧵 Understanding @rustlang's newtype idiom, when and how to use it. 👇

Let's imagine we are building a mini-database for students and professors, here is our starting point.

👇
The idea is very simple:
* we keep track of professors using a u32 id
* we keep track of students using a u32 id

We are using a HashMap here, but eventually, this could be a trait with a real database behind it, so the ids are quite important here as this is how we find objects
Now, we want to implement course registrations. A student can register for the course of a professor.

Here is how the database looks now.

We've added a new course_registrations vector, and we use it to register students for courses and then check if they are registered.
Read 12 tweets
For the last 15 years, I regularly code-read interesting projects and write my own notes about code & arch as I go. This time I'm reading @prisma's codebase.
In one word: clever.

Rarely I come across codebases that tick all the boxes and take all the right trade-offs.
with my commercial projects, I usually find "unfair" advantages; eat the cake and have it too.

* Userland API in a malleable programming language and infrastructure code in Rust, you pay no overhead.
* The extremely right tool for the job
* "Payment" with good interop
The prisma codebase is a masterclass in tradeoff taking, code crafts, and developer experience with very little fluff.
It's given me hours of exciting code reading, and many hours more.

Kudos team Prisma!

#rustlang @prisma
Read 4 tweets
Very Often, #bioinformatics works need side CLI tools for different tasks. @rustlang provides a bunch of new CLI tools delivering improvements other dated UNIX CLI. Here is a thread of those CLI tools. 🧵
Start with exa, a modern replacement for ls. It provides more beautiful, user-friendly, and colored output.
github.com/ogham/exa/raw/…

github.com/ogham/exa
ripgrep, for a fast and user-friendly search with built-in support for compressed files.

github.com/BurntSushi/rip…
Read 12 tweets
Tauri : A toolkit that helps developers make applications for the major desktop platforms - using virtually any frontend framework in existence.

tauri.studio/en/

A Thread !

#rustlang #Rust #wasm #desktop #developers
The core is built with Rust and the CLI leverages Node.js making Tauri a genuinely polyglot approach to creating and maintaining great apps.
Bundle size of a Tauri App can be less than 600KB
Read 5 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!