I have found a way to render lighting in 2D from a single light source and walls of infinitesimal thickness using recursion. Even better: it's in less than 700 blocks. I used to think that there wasn't a way to do this in realtime at this resolution, but apparently there is! There are annoying one-pixel artifacts. Does anybody know how to get rid of them? Contracted future continuitous progressive tense...
Thanks to @-Rex- for inspiration and the triangle filler. Thanks to @iaobardar for alerting me about an even more efficient algorithm. Thanks to @-CoolDesigns- for the optimized insertion sort script. Update Oct 14 2020: Added more platforms and sped up slightly Update Nov 6 2020: Increased block count by adding render process and using much more efficient algorithm, a bit glitchy but will fix Update Nov 6 2020: Was able to fix glitches by taking floor of atan so that floating-point wouldn't skip over platforms without adding blocks Update Nov 6 2020: Found more glitches, fixed by including endpoints in ray-segment intersection Update Nov 6 2020: Added @-CoolDesigns-'(s) binary search insertion sort Update Nov 7 2020: Added only endpoint algorithm, not perfectly efficient but much closer, no longer recurses, also changed light from white to yellow (and mistyped "yelolow" and ")(" and "nad" and "'')(").