« first day (4800 days earlier)      last day (370 days later) » 

00:24
github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/… would it be possible to add flag to token_get_all() to make it fail on syntax errors?
 
3 hours later…
02:54
@Derick this is a meta-paackage containing all inclusing debugger help, I believe ubuntu.pkgs.org/23.10/ubuntu-main-amd64/… should be enough (which is significantly smaller)
But can't tell, never installed rust from a package manager.
 
6 hours later…
09:22
@Derick welcome in rust for php ext, also 400MB of sources (downloaded by cargo) and so very long build
ddtrace, skywalking and recently proposed aerospike :s
10:21
sounds like a terrible progression.
 
4 hours later…
14:02
o/
JRL
JRL
14:43
@Girgias you're GPB on the mailing list right?
Yes I am
Seems we replied at the same time lol
JRL
JRL
okay, i thought i remembered that but couldn't be sure
yeah
i also would say that it makes more sense for literals to be decimals instead of floats
but i feel like that has almost zero chance if passing any vote
I mean, that's a "minor" implementation detail, and I think it is better to be what is the "ideal" situation and argue about this than juste assume it ain't gonna pass
JRL
JRL
if the math functions aren't allowed to be type generic though (pass float get float, pass decimal get decimal) then i would probably oppose it
I mean those functions should be type generic
JRL
JRL
14:48
libmpdec is faster than bcmath by around 10-1000x
depending on operation and number of decimal places
But I agree if people don't want that then having literals be float is kinda needed...
@JRL That I am unsurprised about lol BCMath doesn't look fast at all from just staring at the code
JRL
JRL
libmpdec works on precision instead of scale
which will be different from both floats AND bcmath
so the documentation would have to be very clear about it
Kinda why I'm not super convinced of this being the default thing provided, as I already find this confusing :|
JRL
JRL
PHP floats give you about 12-15 total digits, no matter how you divide them up. bcmath uses scale, which is the total number of digits AFTER the decimal point. precision is the total number of digits after the decimal point with all leading zeros removed (sigfigs essentially)
Also, do people, other than mathy stuff, really use numbers that are larger than 32bits? Like I know I did because I did some numerical computations, but the average PHP project?
JRL
JRL
14:53
average? no
the average php project barely even uses math operators besides + and -
there is some question about how much of this is due to PHP being shit at math, which means people don't try
and how much is actual lack of a use case
i literally took an 8 year detour from writing a game in PHP because i needed to build the math library from the ground up
not many projects going to do that
I mean, I agree. I'm just thinking having a sensible rational number type that is not too insane is a good default, and then having proper numerical extensions is possibly better.
Yah that is some dedication
Anyhoot, I have a dentist appointment to go to
JRL
JRL
you mean a type that has a numerator and denominator?
Yes ;)
JRL
JRL
that would be good yes, but it's not a replacement for decimals in many contexts unfortunately
the math is actually more difficult on the engine in a lot of cases when you get to things like sin() or exp()
good luck at the dentist
15:38
Is where you declare variables important? If I have a large, static string, like an SQL statement, does it have to physically be before it's used or can I stick it at the end to tuck it out of the way? I'm guessing it's the latter because PHP is interpreted not multi-pass compiled.
JRL
JRL
@Jimbus php is shared-nothing. to use a variable, it must be defined before the line it is used.
There's a fine line between a numerator and a denominator!
^dad humor^
@JRL but I can stick it in an external file and require it, right? In SQL statements, I like to stack my column names vertically, but when there are dozens it can create a huge block that's difficult to work around. Just looking to clean things up a bit :)
JRL
JRL
yes, it opens the file and inlines it when you require
@JRL Thank you! You are a Gentleperson and a scholar!
16:15
@JRL You'll need to explain this bit to me
JRL
JRL
@Girgias most of the libraries that have arb. precision implementations of functions like sin() or exp() use optimizations that only work well with decimals
and writing those kinds of optimized algorithms is better studied and understood
you can write A implementation that works with rationals. but writing an EFFICIENT one that works with rationals is quite another matter
the most efficient algorithms for some of these things use imaginary numbers as intermediary steps
doing exp() is much faster if you convert the number to a complex number first and then do polar coordinate math
assuming you have an efficient way to do the complex number conversion
summary: the math is "the same" for rationals and decimals, but the algorithms are easier to optimize for decimals generally, and most of the compsci research into the topic that has been done has been on decimals
Right, but again. I think having an implementation for rationals even if it slow is an OK first step
JRL
JRL
it's not really a first step, it's a different step
like i said, i would enjoy having rationals as well
but they aren't a replacement for decimals really
like mathematically they are, but computationally no
big sad
JRL
JRL
things like sin() and exp() will also not really have a rational answer that has the same "scale" or "size" as the input necessarily either
so the rationals version would either make some pretty restrictive assumptions about what you want
or require the same sort of precision tracking that the decimals would with more steps
another option is to just make functions like sin() and exp() not work for rationals and sidestep the issue
16:55
If anybody has a clever idea, or an opinion, about drupal.org/project/drupal/issues/3405976, I would be glad to hear it.
Anyone familiar enough with sql merge to help me decipher this "using (select :id::int id) as sd2" in

merge into simple_data sd
using (select :id::int id) as sd2
on sd.id = sd2.id

simple_data sd is the target table name renamed to SD with a PK named id. SD2 presumably refers to the array of incoming data bound to be merged ($Data), but I am totally unfamiliar with the syntax
I am getting random segfaults with ASAN after pulling the latest master
Only seem to happen when there is POST data in a PHPT
 
3 hours later…
JRL
JRL
19:41
goddamn
i've been going through my math library with the just released AI Assistant in PHPStorm
how is it?
my kneejerk reaction when I saw the email announcement was "okay, disabling that when I upgrade..."
JRL
JRL
it's actually pretty astute, though it did have some trouble understanding the actual calculation my library did for cosh(). it didn't understand that my calculation was an algebraic reorganization of the definition of cosh() because it was having trouble keeping up with the order of operations with exponents.
it's REALLY good at writing documentation
lol
that's what I've heard with regards to github copilot
JRL
JRL
though it did cause me to start digging into the guts of my library and i rediscovered the most soul-crushing code in it.
emotional damage?
JRL
JRL
19:45
NumberNormalizationTrait.php
This code is necessary for the various types of numbers (fractions, decimals, and complex numbers) to be able to understand how they need to normalize themselves based on what they are and what their argument is for the given mathematical operation
but it also needs to normalize anything that satisfies is_numeric()
with the additional qualification that is ALSO normalizes "2/3" into a fraction object and "2-4i" into a complex number object
JRL
JRL
19:59
uhg. why did i try to make this so comprehensive.
im looking at the code that handles to pow() implementation for a complex number where both the real part and the imaginary part may be arbitrary precision decimals

« first day (4800 days earlier)      last day (370 days later) »