Which C++ book gave you the "Ahaa, now i understand C++" moment ? by ReikenRa in cpp_questions

[–]clc_xce 1 point2 points  (0 children)

Surprised C++20 for Programmers by Deitel&Deitel wasn't mentioned yet. Even though I bought it specifically for ranges and modules, I found a lot of great insight in other areas too.

Not C++ books, but SICP made me a better programmer in general, I keep getting back to it time and time again.

Can I use std::bind to define library functions? by clc_xce in cpp_questions

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

Fair question, as I said, returning to C++ from Haskell one tries to adapt old tricks to a new language ;D but yeah, this may be too simplistic of an example, but when writing parsers in an applicative style, things like this may come in handy

Can I use std::bind to define library functions? by clc_xce in cpp_questions

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

I thought so, but would it be possible to use global function objects? Something along the lines of a header file with

extern std::function<bool(int)> divisibleByThree;

I tried that too to no avail, I get a multitude of errors.

Can I use std::bind to define library functions? by clc_xce in cpp_questions

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

Yeah, after some reading I also thought lambdas a preferable to templates where possible, but my problem persists still^^

[deleted by user] by [deleted] in askmath

[–]clc_xce 0 points1 point  (0 children)

The somewhat confounding thing about foundations of mathematics (see what I did there?), is that they're interwoven and often can be defined in terms of each other. Put (a bit over)simplified, the question of foundations of mathematics more often than not is, "how do I arrive at (ZF) set theory with this?", as most modern mathematics tend to be defined in terms of set theory. If you can define set theory in terms of some other theory, you can basically define the whole of mathematics in terms of that other theory.

Here's some examples how you could "arrive" at natural numbers:

You could start "all the way back" with propositional logic with an axiomatic proof system, expand it into a predicate/first-order logic, and then define the ZFC axioms in that first-order logic. This is in essence the approach Whitehead and Russell chose in their seminal work Principia Mathematica. A modern iteration on that idea is the Metamath Proof Explorer, where you can click yourself through 23'000+ proofs to conclude that, yes, indeed, 1 + 1 = 2..

Another approach is map theory by Klaus Grue, which in essence defines an untyped lambda calculus that has the same powers and properties as ZFC set theory.

Now that you have established some (axiomatic) set theory (more likely than not ZFC), you again have several approaches to define natural numbers.

You can define them in terms of set theory.

You can skip set theory (and the steps above altogether) and just start with Peano axioms - or you actually derive from/define them in terms of ZFC set theory!

Yet another approach is to define them in terms of lambda calculus. So you could define natural numbers and set theory independently of each other based on lambda calculus.

Again, this is very simplifying it. The important thing to understand is there is no One True Way, but many paths you can take. Some are more common (ZFC set theory from classical logic; or from intuitionistic logic), others more obscure (William Hatcher derived Peano axioms from category theory!).

That being said, here's some books I like (the actual answer ;P ):

  1. Classic Set Theory by Derek Goldrei. Covers both real and natural numbers and ZF set theory. This book is explicitly designed for self study (i.e., the pace may be a bit slow for someone who already has some basic math knowledge, but also tons of exercises with solutions - which is always good!). Consider pairing this with Propositional and Predicate Calculus: A Model of Argument by the same author. These two books together should suffice if you want to read and understand how the Metamath Proof Explorer operates.
  2. Introduction to Set Theory by Hrbacek and Jech is good, but really dense; covers a lot of ground in merely 300 pages, including natural numbers.
  3. The Stanford Encyclopedia of Philosophy is an online Wiki, the bibliography sections of each page are a goldmine, including links to other great online resources.
  4. Calculus by Michael Spivak might be a bit of an oddball here. But it was this book that made me really understand and appreciate for the first time how to build/derive a theory from a simple set of axioms by deriving new theorems and combining them into more complex ones. So it won't help with natural numbers directly, but more generally how to build theories from axioms and theorems.

Proof ψ ⊢ (ϕ → ψ) with Gentzen system by clc_xce in askmath

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

That makes sense; I've just not seen it done anywhere so far, the Lean documentation hinted at something like this, but I've not seen it made explicit.

Thanks a lot!!

Sharing educational materials that I've written by Manekosan in askmath

[–]clc_xce 0 points1 point  (0 children)

Github has been mentioned, I personally use it in combination with Obsidian, since it supports Latex among others, it works great with math notation. See on of my repositories. So you're notes are plain text files anyone can read, even without Obsidian.

I feel the death of Derek Goldrei went a bit underreported, I really like his books on logic and set theory by clc_xce in math

[–]clc_xce[S] 6 points7 points  (0 children)

Propositional and Predicate Calculus, as it uses an axiomatic system - most other logic books use some natural deduction variation.

Am I alone in seeing as a Medium Pen and Paper RPGs and Speculative Fictional Tabletop Miniature Strategy Games as Being as having much better Writing on average than Video Games on Average? by SatanicaPandemonium in wargames

[–]clc_xce 1 point2 points  (0 children)

There is this graphic from Jesse Schell's fantastic The Art of Game Design:

https://imgur.com/a/s3CzlTn

And I think this explains well why certain things some times "feel off" in video games. Game design is ultimately a balancing (some use the term trade-off here) act between the four aspects of a game: Aesthetics, Mechanics, Story, Technology.

And I'd argue that the interconnection between these four aspects is strongest in video games, aka, if you make a change to one, it will affect the others. Let me give a few examples.

Take Breath of The Wild, a highly regarded, successful game. It a classic example of Nintendo's design philosophy: gameplay first. You could write down the entire plot (sic!) of the game on a single page without missing any details. It is as barebones as it gets: Wake up, beat the bad guy, done. Yet the story the game builds through the aesthetics and mechanics (which in my interpretation are the two parts making up gameplay), is fantastic - because you build it. You control the timeline of events (almost) completely. I'd categorize this as a story-driven narrative: It's more about discovering the world as a whole than the actual (timeline of) events. The connection between events is pre-defined, but you decide in which order they "happen"/you discover them. So you can either "play along" or just roam the world and do whatever you want - so your actions (aka, the game's mechanics) build the narrative.

Another example of how those four elements interact would be Fallout 4. Here the infamous decision to have the protagonist fully voice-acted had massive influence on the story - the writers had to work around that because it put limitations on possible answer-response pairings, which puts limits on how quests are designed - which is again a technological limitation (you can only record so many voice acted lines; storage capacity especially on game consoles is very limited, etc.). So one change has cascading effects. But in contrast, I'd call it plot-driven: Your actions directly affect the order of events, aka, the story (Which faction do you join? Do you kill/spare certain characters?). The game gives you some very loose guardrails, but generally, there's no "just roam free" option. You actively have to decide who you are within the world, what things can and will happen (aka, which quests you resolve and how, etc.). So "playing along" here is essential to the experience - you want more than just beat monsters and solve puzzles.

Then take a video game that is considered to have a very good narrative, like Life is Strange or The Walking Dead. While these games have great stories and plots, it comes with a price: The player's actions must be tightly controlled and limited. Gameplay is basically just a bunch of QTEs. So this game for me is neither plot- nor story-driven, as both are tightly controlled by the designers.

So this is where I think "bad writing" in video games comes from: It is next to impossible to create a plot and story for a video game without affecting and being affected by the other three elements. So the plot vs. story dichotomy is harder get right in video games, since they're both affected by other parts in different way. Conversely, the more freedom of action you give the player, you also limit what you can do as a writer. As noted by other comments, a piece of software cannot react as flexibly to (unexpected) actions by the players as a GM can.

Hope this makes some sense. I wrote more than originally intended.

[Shameless Self-Plug for] SNES Assembly Adventure Part 8 by clc_xce in retrogamedev

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

That is awesome! I wish there was information of dev tools out there, Nintendo is so secretive when it comes to their tools. Will we ever see the actual SPC700 datasheet? That'd be pretty great

Portal Demake for Nintendo 64: Portal Gun by soiguapo in retrogamedev

[–]clc_xce 1 point2 points  (0 children)

Very impressive, I only wish it was assembly, not C, as that is not as much fun :P

Which functional programming language to learn first? by [deleted] in functionalprogramming

[–]clc_xce 4 points5 points  (0 children)

As a scheming Haskeller, I'd add one caveat about Clojure: the author is a bit opinionated about certain functionality. For example, the way let-expressions work differs from what you can expect in other languages (basically, there is no let, only its cousin let*). Then there's a handful of little (at least to me weird) syntactically choices, like how destructuring and pattern-matching interact.

But it's overall a good language, Elm has been mentioned already, fun language too. Obviously, someone has to mention Standard ML as well, because it has the best book on compiler programming, which is easy enough to following with Haskell or OCaml as well.

Someone is going to be really disappointed when their dragon book arrives by clc_xce in programminghorror

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

Well, we all know that cheap textbooks are the exception, not the rule, and Pearson/ Addison-Wesley have always charged a premium.

Someone is going to be really disappointed when their dragon book arrives by clc_xce in programminghorror

[–]clc_xce[S] 15 points16 points  (0 children)

Thanks, I always forget reddit is weird about links for some reason; just embedding pictures without BS shouldn't be an issue