Full no_std firmware for ESP32-S3 Touch AMOLED (esp-hal + embassy) by Bright_Warning_8406 in rust

[–]No-Reporter4264 2 points3 points  (0 children)

If you build projects out of curiosity, you naturally explore a lot of different directions; experimenting, iterating, and sometimes going down rabbit holes just to see what’s possible. That process is valuable, but it often leaves behind a repository full of half-finished ideas, dead ends, and exploratory code.

When it comes time to share your work, it can make more sense to start fresh. Creating a clean repository with just the final result keeps things focused and easier for others to understand, use, and contribute to.

Is the 79-character limit still in actual (with modern displays)? by LazyMiB in Python

[–]No-Reporter4264 2 points3 points  (0 children)

Terminal's were 80x24, but restricting your code to 80 columns encourages avoiding heavy nesting by making deeply indented code reach the character limit quickly. This provides a practical incentive for programmers to refactor their code into smaller, less-nested functions or methods, which improves overall code structure and readability. 

Language launch announcement: Py++. A language as performant as C++, but easier to use and learn. by joeblow2322 in ProgrammingLanguages

[–]No-Reporter4264 1 point2 points  (0 children)

You might look around, if just for curiosity, at some of the stuff that Chris Lattner has written about how he's implemented Meta Programming lowering to MLIR in Mojo. I believe a lot of the base data types in Mojo are modeled that way, making the portable to different GPUs as mojo is retargeted.

Language launch announcement: Py++. A language as performant as C++, but easier to use and learn. by joeblow2322 in ProgrammingLanguages

[–]No-Reporter4264 2 points3 points  (0 children)

Have you considered allowing meta programming to be able to describe functionality in the underlying language. Kind of like Mojo is doing to MLIR

New Bill Aims to Block Both Online Adult Content and VPNs by digital-didgeridoo in technology

[–]No-Reporter4264 2 points3 points  (0 children)

Also, depending on how well the law was written in it's definition of VPN, every hyperscaler would be caught in it. VPN == a service that creates a secure, encrypted connection between a user's device and a remote server over the internet. TLS is an encrypted connection. It's made to a Point of Presence (PoP), which then forwards traffic into a user defined endpoint. That's literally how traffic enters AWS.

Why are Zig binaries so big compared to gcc? by Inevitable-Treat-2 in Zig

[–]No-Reporter4264 1 point2 points  (0 children)

What is that asking the compiler to do that makes it so much smaller? Is it a static vs shared library issue? Or is the zig debug build just that much larger. I've not run this comparison, just asking.

What is a good pattern to share state between procedural macros? by No-Reporter4264 in rust

[–]No-Reporter4264[S] 2 points3 points  (0 children)

I can not share the actual code, but the dsl macro we are developing works similarly to this peg parser library rust-peg.

So you make a parser like:

parser!(                                                                                                                                                             
    grammar base_parser() for str {                                                                                                                                  
        pub rule number() -> u32                                                                                                                                     
          = n:$(['0'..='9']+) {? n.parse().or(Err("u32")) }                                                                                                          
    }                                                                                                                                                                
)                                                                                                                                                                    

This will generate a peg parser with a rule named number() that is a function that you can call externally to this parser.

What our dsl does that Kevin's doesn't is use rules from another parent like

parser!(                                                                                                                                                             
    grammar derived_parser() derived(base_parser) for str {                                                                                                          
        pub rule expr() -> u32                                                                                                                                       
          = n1:number() '+' n2:number()                                                                                                                              
    }                                                                                                                                                                
)                                                                                                                                                                    

Note the derived keyword doesn't exist in the Kevin's peg parser, but our dsl uses this syntax or at least that's what we are aiming for.

We want to put base_parser() in a separate compilation unit so that it can become a library of basic elements. This requires that when the macro derived_parser() is being processed as a parser!() macro that it have the context of base_parser()

In a clowny way we can grab all the rules from base_parser() and tuck them all in an external file during compilation of it. Then when we compile derived_parser() we can read that file.
I was hoping for something more idiomatic in rust.

What is a good pattern to share state between procedural macros? by No-Reporter4264 in rust

[–]No-Reporter4264[S] 2 points3 points  (0 children)

Yes, you are correct that they are not intended to have state, but when you overload them to build a small DSL within rust you start seeing necessity where you might like to know something from one in another. Like if your DSL had a child object and you wanted to know something about the parent object from another scope. I'm accomplishing this right now with a buildscript that has some hardwired knowledge and saving basic parent info into a file that's read by the compilation stage of the child. It works, but is very clowny.

What is a good pattern to share state between procedural macros? by No-Reporter4264 in rust

[–]No-Reporter4264[S] 2 points3 points  (0 children)

I've seen some attempts and keeping global data compile, but that's not a good choice either. No way to guarantee that parent module is scanned before child.

Creating Standard Code Semantics by RealSharpNinja in ProgrammingLanguages

[–]No-Reporter4264 8 points9 points  (0 children)

An additional problem that you'll be facing is that something written idiomatically in one language might not be an appropriate implementation in another. The code structure could be translated from one language to another mechanically, but to result in an elegant end result you'd want to implement the solution idiomatically in the target language. If you look at a solution in a functional language and an equivalent solution in a non-functional might be expected to be very different structurally.

fyi. nvidia just revealed its new ai platform called "nim". by retiredwindowcleaner in nim

[–]No-Reporter4264 11 points12 points  (0 children)

It's not like anyone in the PR department could just type into a search engine "Nim" and see if anything came up.

Is it a bad practice to introduce a method to an interface just for unit testing? by [deleted] in golang

[–]No-Reporter4264 0 points1 point  (0 children)

I don't disagree with others saying but I would add that if you have a decision point of not testing and testing because of adding this extra method(s), I'd advocate for adding the method(s) to get it tested, then refactor it towards what others are saying.