juan_gandhi: (Default)

"From Mathematics to Generic Programming"

I had ordered this book a couple of years ago, but by my mistake it was delivered to my old Californian address. Just received it eventually, about a month ago.

The book has 14 chapters. I don't know who is Daniel Rose, but everybody (except GenZ) knows Stepanov, who is, I think, an actual founder of map/reduce (but who cares, right?). He has an education in "abstract algebra", as I understand (S.Lang's "Algebra" book is what I see throughout this book), and, since he spent his life programming every since, he didn't add any knowledge above, and the book mixes his "Mekhmat Algebra of year 1972" level with programming practices of 1990-s.

I remember I was doing a similar algebra, but in my case category theory was already looming somewhere above, and, many years later, I figured that all that cheap shit that I was doing in homological algebra can be expressed in about a couple of pages if we show that a couple of important functors are adjoint. Same here: "similarities", mentioned here and there throughout the book are just functors between some abelian categories. OTOH, model theory was almost mentioned.

Still, a good reading, really good, especially for kids.

Also, the book contains a lot of stories from the history: How Euclides got pissed off by his contemporary idiots, how Lobachevsky got pissed off by his contemporary idiots, how Galois pissed of some idiots like Cauchy and eventually he got pissed off and killed by some now forgotten asshole.

We start with finding GCD, and we spend the whole book returning to finding GCD, eventually wrapping up with the explanation of how RSA works. GCD everywhere. Since there are c++ code examples and exercises, a lot of time is dedicated to explaining how code works, and how it should be written. The general approach reminds me what they taught us in the 5th year: performance! efficiency! minimalistic code with no extra instruction! Ok, we need that efficiency for doing RSA, of course, especially finding a couple of good primes. And all these things are good exercises if you are learning, or just want to have fun.

So, I recommend this book as a casual weekend or vacation reading to programmers that for some reason skipped algebra - and also as a good algebraic programming tutorial to the kids who are curious to learn something mathematically deeper than Java OOP or Scala FP.

juan_gandhi: (Default)
"Functors are objects that can be treated as though they are a function or function pointer. Functors are most commonly used along with STLs

src: "functors in C++"




juan_gandhi: (Default)
на плюсах пишут много полезного...

Но ведь язык для пациентов, нет разве?

См пример 

Как может вызваться никогда не вызываемая функция?

juan_gandhi: (Default)
Working Paper for Draft Proposed International Standard for Information Systems - Programming Language C++

(year 1995)

probably about 800 pages.

Let me know if you are local and interested.
juan_gandhi: (VP)
So, I just bumped into this problem being mentioned. "For performance", bounds are not being checked by c programmers, who mostly don't care about any cases except the ones they like.

But well, what's the point in these checkings?

I know three cases.

1. We know during compile time the size of the vector we need, and we should not accept the smaller ones; we should rather not accept the larger ones, but mostly we don't care. This is the case for tuples. It's not an array. If someone wants to pass into the code an array pretending to be a tuple, this fact should be checked at the border. Ok, yes, there are no tuples in C or C++. Well, bad luck, and say hi to the three morons interesting people that provided you with such a language.

2. We don't specify the size, but we have some constraints, like the height of one matrix should be equal to the width of another; or maybe that a vector must contain not less than so many members. Ok, why not have it all in a specialized class? Once the class is instantiated (optionally, with all the checks), there's no way the sizes will change, right? So we don't have to check the bounds.

3. A loose collection of ancient libraries with loose, frequently unknown, requirements. I guess these libraries should be wrapped and hidden from the eyes of a modern human. It's like a slaughterhouse, hardly any modern city dweller wants to see what's going on there.

nanowtf

Jan. 11th, 2016 02:48 pm
juan_gandhi: (VP)
sEmail.replaceAll("\\s", "").trim
juan_gandhi: (VP)
Hey crypto-haskellers! I mean those who know Haskell well and can write anything in it, but have to use C++ or Java, because the world around is pretty dumb and not ready for the truth.

How do you feel, did Haskell help you write more reasonable code?

Actually, there are two questions here:
a) you write in C++
b) you write in Java

I'd love to see examples.

apple swift

Jun. 2nd, 2014 04:22 pm
juan_gandhi: (VP)
So, with the new "Apple language", object-oriented Java people are going to do what?
There must be some deep philosophy, explaining why they are so retarded.
I think.

I mean, I kind of heard an explanation from Josh; in my translation it sounds like this: "Java programmers are not very smart anyway, let's not overload them with closures and all that stuff."

The correlation I was writing about lately kind of shows itself again.
Weird.

Well, it's not Scala, of course; but it's a nice step in the right direction, I think.
juan_gandhi: (VP)
In c++ one can have "unordered set" and "unordered map".

I think they are idiots, ok?
How about unreal integers, non-boolean strings, unsquare circles?
Reminds me some sexist/racist jokes about blondes.
juan_gandhi: (VP)

auto lambda = [cx = cx ] {cx = 10; }


No, it's not scala, it's c++. Better name it c+++.

Anyway. You got the idea.
juan_gandhi: (VP)
тут репост, но неважно

Что интересно - выдумают (а точнее, откроют для себя, после ознакомления с HoTT или элементами теории категорий) какую-нибудь хрень в Хаскеле, тут же где-нибудь в Скале или в С# подхватят; потом Бьярне, который не знает, почему функциональное программирование провалилось и не оправдало надежд, прочитает, ну или ему прочитают, и вот в С++ уже появляется новая революционная фича - хотя, казалось бы, С++ был уже само совершенство до того, и вся эта функциональщина ваша не приносит никакой пользы и только ухудшает эффективность.

До тех пор, пока Бьярне не скажет, что вот эта именно фича, это своевременно и давно пора. Конечно, настанет момент, когда они и от первичности материи откажутся, но он ещё за горами.

И все счастливы; и всем даже кажется почему-то, что С++, будучи совершенством, стал ещё бoльшим совершенством, и развиваться дальше некуда, но нет предела совершенствованию.

Тут можно было бы привлечь индукцию Нётер и её связь с аксиомой фундирования (я на днях обнаружил, что эту связь я когда-то давно переоткрыл, типа лет через 50 лет Эмми - и думал, о, как здорово!).
juan_gandhi: (VP)
"We don't know why functional programming failed"


Posted via m.livejournal.com.



(на видео на 63-й минуте, мой ломаный английский и т.д.)

definition

Aug. 29th, 2010 11:58 am
juan_gandhi: (Default)
Design patterns are standard tricks in OOP languages used in India in mass software production.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10111213141516
17181920212223
24252627282930
31      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 10th, 2025 07:43 am
Powered by Dreamwidth Studios