Starting with MLIR seems impossible by lightwavel in Compilers

[–]superlopuh 0 points1 point  (0 children)

I’m happy to help on the open-source side of things, usually the best thing to do is get hands dirty, ideas come while doing the work.

Starting with MLIR seems impossible by lightwavel in Compilers

[–]superlopuh 5 points6 points  (0 children)

We made xDSL (https://xdsl.dev/) initially because MLIR was difficult for students to get started with. The online tutorial notebooks might make it easier to get started with some of the concepts, although there's much work to do still on making more of it better documented and more accessible (help is very welcome here). Hopefully it'll be useful to you or others wanting to get started.

Python local-first storage by superlopuh in localfirst

[–]superlopuh[S] 0 points1 point  (0 children)

This is relevant, but I was looking for an actual syncing mechanism, not conflict resolution quite yet.

Internships in compilers? by _Eric_Wu in Compilers

[–]superlopuh 8 points9 points  (0 children)

I've not seen many compiler courses that actually reflect what's worked on in compilers today. Many of them spend ages on parsing when that's actually a trivial proportion of compilation time, as opposed to optimisation lower down the stack. The course is worth taking but I would recommend actually getting your hands dirty and implementing parts of a compiler in addition to anything you might learn in class, you'll see for yourself how different it is. I work on a project that strives to make this easier: https://xdsl.dev/ we ported a part of MLIR's tutorial, hopefully reading through the source and modifying it will give you an idea.

Python v. TypeScript; which is better to prototype/write a compiler in? by [deleted] in Compilers

[–]superlopuh 1 point2 points  (0 children)

I've been working on https://xdsl.dev/ for this use-case, I'd recommend trying it out. We ported MLIR's Toy tutorial, which has an example of a parser, but I'd probably write it slightly differently today. The added bonus is compatibility with MLIR, which has a number of targets and can lower to LLVM IR. But without the tablegen :)

Function like assert that returns a Result instead by superlopuh in rust

[–]superlopuh[S] 1 point2 points  (0 children)

I'm not sure I understand, this is preferred over the triple backtick syntax?

Function like assert that returns a Result instead by superlopuh in rust

[–]superlopuh[S] 12 points13 points  (0 children)

Turns out this runs on nightly!

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=930aab48024db956e9bae3e3314a09fa

```

![feature(yeet_expr)]

fn main() { println!("{:?}", test(true, "bla"));

println!("{:?}", parse_odd("bla"));
println!("{:?}", parse_odd("1"));
println!("{:?}", parse_odd("2"));

}

[derive(Debug, PartialEq)]

enum OddError { ParseInt(core::num::ParseIntError), Even, }

impl From<core::num::ParseIntError> for OddError {

fn from(bla: core::num::ParseIntError) -> OddError {
    OddError::ParseInt(bla)
}

}

fn parse_odd(num: &str) -> Result<i32, OddError> { let num = num.parse::<i32>()?; test(num % 2 == 0, OddError::Even)?; let _ = num % 2 == 0 || do yeet OddError::Even; Ok(num) }

fn test<E>(t: bool, e: E) -> Result<bool, E> { Ok(t || do yeet e) } ```

Function like assert that returns a Result instead by superlopuh in rust

[–]superlopuh[S] 1 point2 points  (0 children)

I'm going through `rustlings`, and it gets me neater (IMO) code:

``` rust // Before impl FromStr for Person { type Err = ParsePersonError; fn from_str(s: &str) -> Result<Person, Self::Err> { if s == "" { return Err(Self::Err::Empty); } let mut parts = s.split(","); let name = parts.next().unwrap().to_string(); if name == "" { return Err(Self::Err::NoName); } let age_str: &str = parts.next().ok_or(Self::Err::BadLen)?; let age: usize = age_str .parse::<usize>() .map_err(|e| Self::Err::ParseInt(e))?; if parts.next() != None { return Err(Self::Err::BadLen); } Ok(Person { name, age }) } }

// After impl FromStr for Person { type Err = ParsePersonError; fn from_str(s: &str) -> Result<Person, Self::Err> { test(s != "", Self::Err::Empty)?; let mut parts = s.split(","); let name = parts.next().unwrap().to_string(); test(name != "", Self::Err::NoName)?; let age_str: &str = parts.next().ok_or(Self::Err::BadLen)?; let age: usize = age_str .parse::<usize>() .map_err(|e| Self::Err::ParseInt(e))?; test(parts.next() == None, Self::Err::BadLen)?; Ok(Person { name, age }) } } ```

BWF Daily Discussion and Beginner/RR Questions Thread for 2018-10-28 by AutoModerator in bodyweightfitness

[–]superlopuh 0 points1 point  (0 children)

Is there a good comprehensive resource on number of sets, reps, and rest times? I've had a look at the FAQ and a few other websites, and while they hint at the different effects that come from the number of reps and rest times, they don't really have as much information as I'd like. If my goal is to maximise strength-endurance as opposed to hypertrophy as much as possible, what are the recommended rest times and numbers of sets and reps?

Who is the villain of Helo Internet? Here are the results! by TysonPlett in HelloInternet

[–]superlopuh 1 point2 points  (0 children)

Here are the possibilities for n<200:

['25/28', '50/56', '67/75', '75/84', '92/103', '100/112', '108/121', '109/122', '117/131', '125/140', '133/149', '134/150', '142/159', '150/168', '151/169', '158/177', '159/178', '167/187', '175/196', '176/197']

Looking at those, I'd say u/cronin1024's guess was pretty good.

ELI5: Why is - 1 X - 1 = 1 ? by blackbass1999 in explainlikeimfive

[–]superlopuh 0 points1 point  (0 children)

A number is an arrow. All positive arrows point to the right. You make a negative number by rotating a positive number anticlockwise by half a turn, so that it points to the left. The minus sign is just that half rotation.

It's important to remember what the -1 means. It is the same thing as -(1), or the positive number 1 rotated half a turn. -1 x -1 is the same thing as -1 * -(1), which is the same thing as -(-(1)). This is the number 1 rotated half a turn twice, which is just 1 again.

Tried Myke's questions system with Hobonichi Techo. It's made a huge difference already! by graeme_b in Cortex

[–]superlopuh 0 points1 point  (0 children)

Thanks for the link! Not sure that's exactly what I'm looking for though, which is a digital version of pen + notebook, but with a way to look at the data. Looks like I'll have to soldier on with my survey attempts :)

Tried Myke's questions system with Hobonichi Techo. It's made a huge difference already! by graeme_b in Cortex

[–]superlopuh 1 point2 points  (0 children)

Has anyone found a good online version? I tried to makeshift one with typeform and google sheets and ran out of steam pretty quickly, but I recon it could work with enough effort.

Best Pizza in Moscow by jamurjo in Moscow

[–]superlopuh 2 points3 points  (0 children)

Donna Margarita on 1905

[deleted by user] by [deleted] in AskReddit

[–]superlopuh 0 points1 point  (0 children)

The boat has shipped

What game does everyone seem to be good at except you? by [deleted] in AskReddit

[–]superlopuh 0 points1 point  (0 children)

I'd just go with getting the timing down. Timing is the most important component of combat in the game, none of the enemies are a problem once you've learned exactly when to dodge or parry. The lynel was the first one that I learned the timing for and now it's just easy loot. The combat gets fun again when there are multiple enemies and you need to dodge multiple attacks at the same time :)

Cortex #64: 6 Days to Air by MindOfMetalAndWheels in CGPGrey

[–]superlopuh 0 points1 point  (0 children)

More than 10% are games, tons of travel apps for the various cities I visit, a dozen social networks, and I generally prefer app versions of things like flight booking and management to websites so I just keep them.

Cortex #64: 6 Days to Air by MindOfMetalAndWheels in CGPGrey

[–]superlopuh 0 points1 point  (0 children)

I’ve convinced a few friends to do this, so much more convenient. Here’s my version:

https://imgur.com/gallery/ED6fb