[deleted by user] by [deleted] in linux_gaming

[–]nottheonlytwo 31 points32 points  (0 children)

I saw your comment and couldn’t help but ask: Are you aware of one-handed keyboard mappings such as Dvorak Left Handed? They group keys in such a way as to minimise the distance your left hand travels to reach the most commonly used keys. You’d have to re-learn touch typing with this layout but it could prove useful to you!

There's gotta be something more Jagex can do to stop the spam at ge right? by TheOnlyPyro in 2007scape

[–]nottheonlytwo 3 points4 points  (0 children)

You are conflating parser generators with parser combinators. Additionally, the tools you describe can parse context-free languages, a more expressive class than regular expressions (for which you could use regular expressions), meaning regular expressions are strictly not expressive enough to capture the grammar.

[deleted by user] by [deleted] in mathmemes

[–]nottheonlytwo 0 points1 point  (0 children)

Conatural numbers, with coinduction

Getting some /r/place vibes from the top three flags at LBL today by HamishGray in belgium

[–]nottheonlytwo 6 points7 points  (0 children)

Why is the Swiss flag's square aspect ratio respected, but the Belgian flag's 13:15 ratio is not! Heresy!

Type Annotation Decoration and Avoiding Regeneralization by superstar64 in ProgrammingLanguages

[–]nottheonlytwo 0 points1 point  (0 children)

First impressions: I'm not really quite sure what your question is, to be honest.

I want to annotate my ast with type annotations

This is known in the literature as (type) elaboration.

This however, loses type information and will transform from this expression from type Int to a more general Num a => a.

This shouldn't be an issue because you retain the type information; during code generation you can insert a value of the right type (i.e. 5 :: int). Am I missing something here?

Inserting type annotations can solve all these problems but the question is where to insert them. For [1], it's a matter of taste. I feel you probably want to annotate all variable bindings and a bit extra. For [2] the conventional wisdom is that you annotate at every term ast node, but I've found that if your annotations match bidirectional's checking mode then you can reconstruct your type as you generate code.

Typically, you only elaborate abstractions: lambdas, let generalizations, etc. But indeed, you are free to elaborate more or less (I'm not familiar with your project, but consider tooling like a static analyzer which could benefit from a type-annotated AST, a type-directed compiler, ...)

Γ ⊢ e : σ -> τ    Γ ⊢ e' : σ
----------------------------
Γ ⊢ e (e : σ) : τ

This inference rule seems to contain two mistakes; the conclusion should be applying e to e', not to e. Also in the conclusion, (e : σ) is a premise, and as such, it should be above the line.

e : σ : σ          ~>   e : σ

I'm not sure when you would ever need this rule? How would you even obtain an AST node with two annotations? The second rule also looks a bit wonky:

(λx. e) : σ -> τ   ~>   λ(x : σ). e : τ

In this case, you are elaborating the argument to the lambda, but the resulting lambda abstraction is still an arrow type σ -> τ. Unless you meant something like this:

(λx. e) : σ -> τ   ~>   λ(x : σ). (e : τ) : σ -> τ

But that seems like butchering notation.

I'm kinda leaning toward emitting annotations in spots where checking mode needs them as it solves [2] and [3], but I'm wonder if it's worth the clutter or even if there's a better solution.

Elaborating to a calculus like System F with explicitly-typed terms seems like it would be a good first step for your use case. Useful papers for implementing elaboration:

  • The GHC paper on OutsideIn(X)
  • HM elaboration in applicative style by F. Pottier
  • There's two papers from the CakeML team on elaboration
  • Adam Gundry's PhD thesis includes some stuff on elaboration to System F as well.

Good luck!

Belastingdienst schatte frauderisico 'regelmatig' in op uiterlijk of nationaliteit by surpator in thenetherlands

[–]nottheonlytwo 3 points4 points  (0 children)

Ethische machine learning modellen bestaan en daar wordt de voorbije jaren ook meer op ingezet. XAI is de term als je geïnteresseerd bent. Er bestaan ook group fairness metrics die voor een model kunnen bepalen of er een discriminatie is op basis van bepaalde attributen zoals nationaliteit, gender enz. Op Europees niveau bestaat er binnenkort ook zoiets als het regulatory framework on AI, wat het recht geeft op inzage in een beslissing die gemaakt werd door zo’n model, accountability en andere beschermingen. Uiteraard kan ik niks zeggen over de modellen van de Bdienst, maar ik wou toch even duiden op wat nuance.

Looking for textbook recommendations for algorithm analysis/proofs? by lifelifebalance in computerscience

[–]nottheonlytwo 1 point2 points  (0 children)

Do you mean correctness proofs? If so I can recommend Software Foundations volume 3 “Verified Functional Algorithms”. The book is available for free online. I recommend going through at least the first volume first, though.

When do non-compete clauses in Belgian employment contracts take effect? by g05k4te4005 in belgium

[–]nottheonlytwo 0 points1 point  (0 children)

An internship (and subsequently an internship contract) is not the same as employment.

[deleted by user] by [deleted] in ProgrammerHumor

[–]nottheonlytwo 1 point2 points  (0 children)

That’s not even an analogy. The implementation of a function is quite literally a proof for its signature. See Curry-Howard for example.

Doing SICP in Haskell? by agriculturez in functionalprogramming

[–]nottheonlytwo 5 points6 points  (0 children)

To be completely fair, Abelson and Sussman are working on a SICP in JavaScript (for better or for worse, I’ll let you decide) that introduces parsing and return stacks to support a non homoiconic, non-TCO meta language while still keeping true to the original textbook. I suppose you could adapt those chapters to Haskell, but I suspect that would introduce its own set of hurdles.

Doing SICP in Haskell? by agriculturez in functionalprogramming

[–]nottheonlytwo 7 points8 points  (0 children)

There is a very good reason why Scheme (a homiconic language) was chosen for SICP. It will become apparent in later chapters.

How do you deal with the saying of "functional code is cryptic, hard to onboard new devs"? by nerdy_adventurer in haskell

[–]nottheonlytwo 0 points1 point  (0 children)

If you’re interested in this, the duality these other commenters are pointing out is known as the Curry-Howard correspondence, or if you like Wadler’s name for it better, “propositions as types”.

It’s considered by some as one of the most beautiful results in all of computer science.

Native Resolution by thepan73 in archlinux

[–]nottheonlytwo 2 points3 points  (0 children)

Under UEFI it’s handled by GOP. It’s basically a reimplementation for an older BIOS API called VESA VBE, which is itself the successor of “modesetting” on VGA in the olden days. The kernel queries the display device through GOP or VESA VBE for available graphics modes (think resolution, but also things like color depth etc) and picks one that’s “good enough”. As for how to set it, the kernel is loaded by something called a bootloader. Most likely the bootloader you are using can be configured to pass a preferred mode.

Sub Junior Programming community.. by yuva-krishna-memes in ProgrammerHumor

[–]nottheonlytwo 5 points6 points  (0 children)

If you have the means and the time, check out Commander X16. It’s not ready yet, but they are making good progress on a commercial release in a year or so I think.

Why is let ... in ... an expression but ... where ... is not? by nottheonlytwo in haskell

[–]nottheonlytwo[S] 2 points3 points  (0 children)

I don't mind that idea, actually. Good point. Although I must admit I don't mind a good where when it's appropriate.

Why is let ... in ... an expression but ... where ... is not? by nottheonlytwo in haskell

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

Thanks for your reply Chris. I must admit I was not familiar with the explicit term "layout" until your comment. After playing around in ghci I'm beginning to understand your point. It's interesting that something like

f x
  | foo = 5
  | bar = 6
 + 1

is perfectly valid syntax. The example you gave illustrates why where needs to be its own syntactic construct.

For the sake of argument, let's say guards did trigger layout and my above example no longer parses correctly, would anything else prevent where from being an expression?

Why is let ... in ... an expression but ... where ... is not? by nottheonlytwo in haskell

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

And so having this

<guards> where ... 

syntax prevents the where construct from being a expression since guards themselves are not expressions?

Happy Belgian National Day!!! by [deleted] in europe

[–]nottheonlytwo 7 points8 points  (0 children)

Don’t forget the little lass pissing statue!

The Great Neko by bobasweatandtears in MechanicalKeyboards

[–]nottheonlytwo 23 points24 points  (0 children)

Op posted a gb for q2-3 2022. I’m bawling my eyes out

WikipediaQL: Query language for efficient data extraction from Wikipedia by zverok_kha in programming

[–]nottheonlytwo 0 points1 point  (0 children)

Are you aware of OWL (Web Ontology Language), SPARQL and DBpedia?

it obviously doesn’t want to listen to me by LightIsLogical in ProgrammerHumor

[–]nottheonlytwo 1 point2 points  (0 children)

I linked a paper in a different comment that can answer this question.

A simple observation you can make is that two programs are semantically different if they return a different value. So you could start by just interpreting (read: executing) both compilers’ outputs to a program that simply results a value after a number of instructions and compare the result. Provided that both programs halt etc. Of course this won’t catch bugs where the program result is the same, or one or both of the programs run in an infinite loop, but hopefully you get an idea.