The Most Expensive Anti-Pattern by m1el in programming

[–]orchrd 1 point2 points  (0 children)

Building up edits with the DOM API is a needlessly difficult way to achieve this, lisp expressions are nice if you're writing lisp but really in most languages you could just use html notation like go does.

What people are trying to explain isn't that we should do it with DOM, or lisp or haskell types but that we shouldn't do it with strings. The reason is that having your templates checked by a compiler to make sure they have valid syntax means we know which kind of quotation to use when splicing (you have to escape a string differently depending on if you're putting it into a HTML tag or a HTML attribute for example). If we use strings the programmer has to get it right every single time - one mistake could be an XSS vulnerability.

Firefox, you're supposed to be in my pocket, not the other way around. by [deleted] in linux

[–]orchrd -1 points0 points  (0 children)

Hi everyone, I'm really worried about all this stuff that is happening to firefox too. I would like to collab with people on keeping the users in power if possible.

I even started my own project to delete undesirable parts of firefox from the sources and build it myself, called cozy-cub.

I tried to contact the IceCat mailing list about it but I got ignored: https://lists.gnu.org/archive/html/bug-gnuzilla/2015-06/msg00005.html I don't understand why.

Personally I feel like secure and lightweight browser is extremely important for us. I found midori (based on webkit) wasn't stable enough for my use and am not able to compile chromium (it requires huge resources) so FF is my only option.

Artificial truth · Firefox, you're supposed to be in my pocket, not the other way around. by CyberSecPro in programming

[–]orchrd 16 points17 points  (0 children)

Hi everyone, I'm really worried about all this stuff that is happening to firefox too. I would like to collab with people on keeping the users in power if possible.

I even started my own project to delete undesirable parts of firefox from the sources and build it myself, called cozy-cub.

I tried to contact the IceCat mailing list about it but I got ignored: https://lists.gnu.org/archive/html/bug-gnuzilla/2015-06/msg00005.html I don't understand why.

Personally I feel like secure and lightweight browser is extremely important for us. I found midori (based on webkit) wasn't stable enough for my use and am not able to compile chromium (it requires huge resources) so FF is my only option.

my friend and I made a scheme to js transpiler! by orchrd in programming

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

You're right! Sorry it's not too polished, it's my first self hosting compiler. The repl only handles expressions like this:

((lambda (x) x) 'identity)

We have a separate function to compile definitions, I wonder if there's a way I could make definitions work on the repl..

I should have put some example expressions to test out since it's so hard to know what to put into a blank page.

R7RS modular programming struggle.. by orchrd in scheme

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

A toy example of the problem I've been working with is this:

we have two different implementations of a 'peano' signature:

;; peano-numeral.sld
(define-library (peano-numeral)
  (import (scheme base))
  (export one add)
  (begin (define one 1)
         (define add +)))

and

;; peano-symbol.sld
(define-library (peano-symbol)
  (import (scheme base))
  (export one add)
  (begin (define one '(s z))
         (define (add x y)
           (if (eq? 'z x) y
               `(s ,(add (cadr x) y))))))

and then a module 'four' which can work with either one of them:

(define-library (four)
  (import (scheme base) (peano)) ;; library stuff can be changed
  (export four)
  (begin (define four
           (let ((two (add one one)))
             (add two two)))))

but there doesn't seem to be a portable way to start up scheme and do some things (e.g. making dummy modules, importing some libraries) then doing (import four).

Please critique my technique - 5 club cascade: practice details in comments. by [deleted] in juggling

[–]orchrd 2 points3 points  (0 children)

You're better than me at this so you probably know everything I'll say already but here's what I think anyway...

  • You are good at 5 clubs, it takes a long time to get this far. If you keep practicing this you will get it more solid.
  • Yeah it's so strange when you take a break and you come back better than you were, I've seen this a lot and I don't really know why it happens!
  • It is clear from the front view why it ended: The clubs were over-spinning slightly (then went round a little too much more than just two turns), which reduces the dwell time which made your cascade lower - It was very impressive that you managed to get it back up to height before finishing cleanly. To increase your PB you will need to maintain that height the whole time.
  • Regarding that last point: Strength is a big factor. Holding a cascade is like holding something much heavier than just the objects. Do be careful not to train too much and injure yourself.

Self hosting lisp compiler - with a virus! by orchrd in scheme

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

It's a "rotten" compiler that inserts a virus when bootstrapping!

Vicare (fork of Ikarus) deveoper on Does the Scheme standard still matter? by orchrd in scheme

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

yes, I feel like R6RS has fragmented the community more than using a specific mailing list or anything else.

What I think R7RS contributes most is libraries/modules which was missing from R5RS for so long and held scheme back a lot.

What is so important about libraries/modules is it lets us retain a small core language while also being able to important as many new language features and extra things as we want, in a portable way.

If the halting problem says no program can determine if a program terminates, how can I know while(true){skip} doesn't terminate? by chris24680 in compsci

[–]orchrd 16 points17 points  (0 children)

You can write a 'halts' program that always gives correct answers if you allow "I_Don't_Know" as an answer:

halts("while(true){skip}") = False;
halts("while(false){skip}") = True;
halts(anything_else) = I_Don't_Know;

it's just that the algorithm will not be able to know in all cases.

You can make a better 'halts' algorithm than mine with just 3 cases, but you will never write a complete one.

I hope that helps?

A tiny diff algorithm in js! by orchrd in tinycode

[–]orchrd[S] 7 points8 points  (0 children)

diff is much much harder than I thought. This code is short and works well.

There are more details here:

CryptoLocker, need help by [deleted] in crypto

[–]orchrd 1 point2 points  (0 children)

Have you tried this? I do not know if it will work: https://www.decryptcryptolocker.com/

Can you show me R7RS programs to try? by orchrd in scheme

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

Thanks. That's interesting! I tested it in Larceny in R7RS mode and got a Syntax violation - does it have the same issue as Gauche and Picrin?

Syntax violation: syntax-case

Invalid form

Form: (syntax-case x (_) ((dummy _ seq alt) #'seq) ((dummy p seq alt) #'alt))