Here are slides from by talk at @scalar-conf.com about #macros in #scala
mateuszkubuszok.github.io/ScalaStandar...
use loess::quote_into_mixed_site; use proc_macro2::{Span, TokenStream}; fn my_quote(span: Span, root: &TokenStream, output: &mut TokenStream) { quote_into_mixed_site!(span, root, output, { // Emits `b`. {#if false { a } else { b }} // Emits `e`. {#if false { a } else for _ in 0..0 { b } else while let Some(0) = None { c } else match 0 { 1 => { d } _ => { e } }} }); }
Interlaced (procedural) templating can be really nice I think, as long as the syntax is clean and bracket-nesting is strict.
This loess macro is pretty clean too by the way, it's (mostly) not a muncher and you can use `{#raw { … }}` to emit long runs of token trees more efficiently also at runtime.
why do protein bars and drinks have to taste like chalk
who hurt you
"food is fuel, not fun!"
I shouldnt have to eat a damn floor tile to get my macros, bub
#protein #macros
#ibefartin #protein #macros
according a macros calculator, I need 269 (nice) grams of protein
sooooo much
I'mma be like
One more proof by construction that we can improve derivation in #scala with #macros:
github.com/nguyenyou implemented sanely automatic derivation for Circe, and got some really nice numbers.
github.com/nguyenyou/ci...
Photo Journal 10/11/2021 (Blue Lake)
joesnotesblog.com/blog/photo-j...
#birds #blog #BlueLake #flowers #journal #nature #naturephotography #OR #Oregon #photoblog #photography #PNW #Portland #squirrel #ducks #ducks #parks #waterfowl #macros #macrophotography #mushrooms
Last week I went out for a Friday night beer with friends, and left Claude running. After recent batches of improvements I hoped that Hearth was finally at the stage when I would be able to write a whole type class derivation with no bugs in my macro utilities. #scala #macros
A close-up photograph showcases the vibrant pink blooms of a cactus, emphasizing their intricate details and lively yellow centers, symbolizing the beauty of desert flora.
Barrel cactus bloom. Found in the White Tank hills in Arizona.
#photography #macros #macrophotography #flowers #cactus
Morning Two-spotted Longhorn #Bee on Cosmo #flower from my summer #Philly #garden. 🌞 #FlyDay #macros #pollinator #insects #nature #eastcoastkin #bugsky
Here comes the sun
#winter #frozen #bubbles #monday #sunrise #akron #ohio #macro #macrophotography #macros #macrophoto
Frozen soap bubble catching the light of the sunset - looks like a fiery ice ball
Frozen sunrise
#winter #frozen #bubbles #fire #sunset #akron #ohio #macro #macrophotography #macros #macrophoto
#Makros #Insekten #Makrofotografie #Macros #Insects #Fotografie #Foto #Close-up #Macrophotographie #Photographie
#Makros #Insekten #Makrofotografie #Macros #Insects #Fotografie #Foto #Close-up #Macrophotographie #Photographie
Soap bubble freezing
Frozen sunrise
#winter #frozen #bubbles #rainbow #sunrise #akron #ohio #macro #macrophotography #macros
water droplet reflecting a Japanese maple
Water droplet and flower
Experimenting with #macros of #water #droplets after some much needed #rain.
#macro #macrophotography #closeup #photography #reflections #waterIsLife #nikon #nature #naturePhotography
Saturday protein check: if your lunch had less than 25g of protein, that wasn't lunch. That was a snack with ambitions.
Track it. Fix it. Repeat.
#macros #protein #nutrition
A fierce predator, it feeds on small invertebrates such as insects and spiders. It is nocturnal, using its venomous front legs (forcipules) to paralyze prey.
#UKWildlife, #UKNature, #Invertebrates, #Macros, #Wildlife, #Nature
youtu.be/Do4XqSveGH4
A striking close-up image of an Echinacea flower showcases its vibrant orange and yellow petals surrounded by a blurred natural background, highlighting the intricate details of its structure.
Very new prairie coneflower from spring of 25.
#photography #macrophotography #macros #flowers
Saturday morning protein check: if your breakfast had less than 25g of protein, that wasn't breakfast. That was a snack with ambition.
Track it. Know it. Fix it. chowdown.me is free forever 🍳
#macros #proteinintake #caloriecounting
Frozen bubble catching the morning sunrise
Frozen sunrise
#winter #frozen #bubbles #rainbow #sunrise #akron #ohio #macro #macrophotography #macros
A Greggs sausage roll: 19g of protein.
A £3.50 "protein bar" from the gym: 20g of protein.
One costs 65p and brings genuine joy. The other tastes like chocolate-flavoured ambition.
Track your food for a week. Protein is hiding everywhere.
#macros #protein #sausageroll
Today I've been playing around with Immutable.js as a library that supplies immutable collection for JavaScript and TypeScript. Something that's relatively annoying at first sight (cause _verbose_) is how they handle typed Objects (_Records_). I'm not completely sure yet, but I _think_ in TypeScript you want to declare sums of products using those records something like this: ```js import { Record } from 'immutable' type IdleT = { kind: 'Idle' } type Idle = Record<IdleT> const Idle = Record<IdleT>({ kind: 'Idle' }) type TrackT = { id: string; url: string; title: string } type Track = Record<TrackT> const Track = Record<TrackT>({ id: '', url: '', title: '' }) type LoadingT = { kind: 'Loading'; track: Track } type Loading = Record<LoadingT> const Loading = Record<LoadingT>({ kind: 'Loading', track: Track() }) // .. export type State = Idle | Loading // | .. ``` This is, compared to ```js export type Track = { id: string; url: string; title: string } type Idle = { kind: 'Idle' } type Loading = { kind: 'Loading'; track: Track } // .. export type State = Idle | Loading // | .. ``` quite the feat syntax-wise. It can be alleviated a bit by doing something like this: ```js export const makeRecord = <T extends object>(defaults: T) => Record<T>(defaults) const Idle = makeRecord({ kind: 'Idle' as const }) type Idle = RetureType<typeof Idle> ``` But even that is still double the code and more mental workload payed as a price for immutability. So I wondered: > Are there people writing Macros in TypeScript? And as it turns out, there are: - ts-macros - macro-ts But nope, I'm not gonna use them.
TypeScript Macros
#TypeScript #Macros #FunctionalProgramming #Immutable.js
Looking through the leaf litter, under rocks and roots in the woods we found a scorpion!
Well, not a real one with a venomous sting , but a Pseudoscorpion.
#UKWildlife, #Wildlife, #Invertebrates , #Arachnophiles, #Macros
youtu.be/_qSg9c3FJA0
High Calorie Nutrition without Junk Bulking 🥗🥩
🥔 Use “clean calorie density” staples
🫒 Add calories through “mix-ins,” not extra meals
🥤 Lean on liquid calories when appetite is the bottleneck
#nutrition #diet #calories #protein #macros
Setting up button designs for my Elgato Stream Deck! I didn't save the old profile when I was updating my PC, but I think it's time to make a fresh profile anyways.
Got the first page sorted, now... what else to add?
#twitch #streamer #streaming #macros
Training Day 🆚 Rest Day Nutrition 🥗
These points matter because they let you lose fat without sacrificing gym performance or muscle.
🍗 Keep protein the same on both days.
🍞 Shift carbs toward training days.
🫒 Let fats “fill the gap” on rest days.
#nutrition #diet #calories #macros
#dinner and #macros for today!
I would have taken a picture of the delicious burger that my partner made for me, but I was so fat I inhaled it 😁 hopefully we can get some rest and not get called in. Sweet dreams, munchkins!
#weightlossjourney
#delicious
#meals
🥩 High Protein Snack Swaps 🍗
Protein snack swaps matter because they let you increase muscle-building nutrition without “trying harder.”
You keep the same snacking habit, but you change what that habit does for your body.
🎯 Aim for 15–30g Protein Per Snack
#highprotein #macros #snacks #diet