Reddit Programming – Telegram
Reddit Programming
211 subscribers
1.22K photos
125K links
I will send you newest post from subreddit /r/programming
Download Telegram
Pulse 1.0.4: deterministic concurrency, CLI tools and full templates
https://www.reddit.com/r/programming/comments/1owss92/pulse_104_deterministic_concurrency_cli_tools_and/

<!-- SC_OFF -->Hi everyone, I have been working on a small language called Pulse, a language that compiles to JavaScript but runs on its own deterministic runtime. If you like the idea of deterministic scheduling, channels and select inspired by Go, reactive signals, structured concurrency, and full JS ecosystem compatibility, you might find this interesting. What is Pulse Pulse is a small language with: deterministic cooperative scheduler CSP style channels and select signals, computed values and effects a full compiler pipeline: lexer, parser and codegen ES module output compatible with Node, Vite, Next, React, Vue Same inputs always produce the same async behavior. What is new in version 1.0.4 Version 1.0.4 focuses on real usability: stable CLI: pulse and pulselang commands create app tool: npx create-pulselang-app my-app full templates: React, Next and Vue templates now build correctly deterministic runtime verified again with fuzz and soak tests documentation and examples fully corrected ready for real world experiments Small example import { signal, effect } from 'pulselang/runtime/reactivity' import { channel, select, sleep } from 'pulselang/runtime/async' fn main() { const [count, setCount] = signal(0) const ch = channel() effect(() => { print('count is', count()) }) spawn async { for (let i = 1; i <= 3; i++) { await ch.send(i) setCount(count() + 1) } ch.close() } spawn async { for await (let value of ch) { print('received', value) } } } The scheduler runs this with the same execution order every time. How to try it Install: npm install pulselang Run: pulse run file.pulse Create a template app (React + Vite + Tailwind): npx create-pulselang-app my-app cd my-app npm run dev Links Docs and playground: https://osvfelices.github.io/pulse Source code: https://github.com/osvfelices/pulse If you try it and manage to break the scheduler, the channels or the reactivity system, I would love to hear about it. <!-- SC_ON --> submitted by /u/coloresmusic (https://www.reddit.com/user/coloresmusic)
[link] (https://osvfelices.github.io/pulse) [comments] (https://www.reddit.com/r/programming/comments/1owss92/pulse_104_deterministic_concurrency_cli_tools_and/)
Build an Image Classifier with Vision Transformer
https://www.reddit.com/r/programming/comments/1owti39/build_an_image_classifier_with_vision_transformer/

<!-- SC_OFF -->Hi, For anyone studying Vision Transformer image classification, this tutorial demonstrates how to use the ViT model in Python for recognizing image categories.
It covers the preprocessing steps, model loading, and how to interpret the predictions. Video explanation : https://youtu.be/zGydLt2-ubQ?si=2AqxKMXUHRxe_-kU You can find more tutorials, and join my newsletter here: https://eranfeit.net/ Blog for Medium users : https://medium.com/@feitgemel/build-an-image-classifier-with-vision-transformer-3a1e43069aa6 Written explanation with code: https://eranfeit.net/build-an-image-classifier-with-vision-transformer/ This content is intended for educational purposes only. Constructive feedback is always welcome. Eran <!-- SC_ON --> submitted by /u/Feitgemel (https://www.reddit.com/user/Feitgemel)
[link] (https://eranfeit.net/build-an-image-classifier-with-vision-transformer/) [comments] (https://www.reddit.com/r/programming/comments/1owti39/build_an_image_classifier_with_vision_transformer/)
DNS Resolution Delay: The Silent Killer That Blocks Your Threads
https://www.reddit.com/r/programming/comments/1ox0lkn/dns_resolution_delay_the_silent_killer_that/

<!-- SC_OFF -->The Blocking Problem Everyone Forgets Here’s the thing about DNS lookups that catches people off guard. When your service needs to connect to another service, it has to resolve the hostname to an IP address. In most programming languages, this happens through a synchronous system call like getaddrinfo(). That means the thread making the request just sits there, doing nothing, waiting for the DNS response. Normally this takes 2-5 milliseconds and nobody notices. You have a thread pool of 200 threads, each request takes maybe 50ms total, and you’re processing thousands of requests per second without breaking a sweat. The occasional DNS lookup is just noise in the overall request time. But when DNS gets slow, everything changes. Imagine your DNS resolver is now taking 300ms to respond. Every thread that needs to establish a new connection is now blocked for 300ms just waiting for DNS. During that time, incoming requests pile up in the queue. More threads pick up queued requests, and they also need new connections, so they also get stuck on DNS. Before you know it, your entire thread pool is blocked waiting for DNS responses, and your service is effectively dead even though your CPU is at 15% and you have plenty of memory. https://howtech.substack.com/p/dns-resolution-delay-the-silent-killer https://github.com/sysdr/howtech/tree/main/dns_resolution <!-- SC_ON --> submitted by /u/Designer_Bug9592 (https://www.reddit.com/user/Designer_Bug9592)
[link] (https://howtech.substack.com/p/dns-resolution-delay-the-silent-killer) [comments] (https://www.reddit.com/r/programming/comments/1ox0lkn/dns_resolution_delay_the_silent_killer_that/)
Markdown files not openable because of GitHub Copilot · Issue #277450 · microsoft/vscode
https://www.reddit.com/r/programming/comments/1oxuk2c/markdown_files_not_openable_because_of_github/

<!-- SC_OFF -->You must click on the Copilot status bar, then click either "Set up Copilot" or "Skip for now". Disable GitHub Copilot/reload/ Reload with extensions disabled won't help. <!-- SC_ON --> submitted by /u/lactranandev (https://www.reddit.com/user/lactranandev)
[link] (https://github.com/microsoft/vscode/issues/277450) [comments] (https://www.reddit.com/r/programming/comments/1oxuk2c/markdown_files_not_openable_because_of_github/)
Refactoring Legacy: Part 1 - DTO's & Value Objects
https://www.reddit.com/r/programming/comments/1oy1ces/refactoring_legacy_part_1_dtos_value_objects/

<!-- SC_OFF -->Wrote about refactoring legacy systems using real-world examples: some patterns that actually help, some that really don’t and a cameo from Mr Bean’s car. Also: why empathy > clever code. Code examples are in PHP (yes, I know…), but the lessons are universal. <!-- SC_ON --> submitted by /u/clegginab0x (https://www.reddit.com/user/clegginab0x)
[link] (https://clegginabox.co.uk/refactoring-legacy-part-1-dtos-value-objects/) [comments] (https://www.reddit.com/r/programming/comments/1oy1ces/refactoring_legacy_part_1_dtos_value_objects/)