HN user

vanni

1,721 karma

SW Eng, Italian living in Italy.

CTO @ Jet HR. Formerly CTO @ Fiscozen.

Started coding at 5 on a VIC-20.

#remote #linux #python #django #vue #aws

https://www.linkedin.com/in/ingtotaro

Posts102
Comments187
View on HN
twitter.com 2mo ago

SubQ – a major breakthrough in LLM intelligence

vanni
20pts2
old.reddit.com 6mo ago

The latest Firefox version broke ChatGPT website

vanni
9pts7
www.joshwcomeau.com 4y ago

My Custom CSS Reset

vanni
2pts0
levelup.gitconnected.com 6y ago

No Cookies, No Problem – Using ETags for User Tracking

vanni
11pts7
fabiensanglard.net 6y ago

Revisiting the Business Card Raytracer

vanni
176pts52
www.cnet.com 6y ago

The strange origins of tech terms you hear every day

vanni
1pts0
www.nytimes.com 6y ago

Kazuhisa Hashimoto, 61, Who Created the ‘Konami Code’ Video Game Cheat, Dies

vanni
1pts0
usesthis.com 6y ago

Uses This: Bram Moolenaar (Vim Creator)

vanni
2pts0
www.dropbox.com 7y ago

What's New in Dropbox Plus

vanni
1pts0
www.helpnetsecurity.com 7y ago

Crypto breakthrough (handshake-style encryption for time-delayed communications)

vanni
4pts0
bytemybits.gitlab.io 8y ago

The Four Types of Remote Work

vanni
1pts0
www.zeichenschatz.net 8y ago

How to start with variable fonts on the web

vanni
2pts0
www.youtube.com 8y ago

The Secret of Monkey Island

vanni
2pts0
jacobian.org 8y ago

A reading list for new engineering managers

vanni
2pts0
mail.python.org 8y ago

Python startup time: milliseconds matter

vanni
662pts378
medium.freecodecamp.org 8y ago

The best of Python: a collection of favorite articles

vanni
3pts0
bloomca-me.github.io 8y ago

Asynchronous JavaScript Patterns: Promises Tips and Tricks

vanni
2pts0
lobste.rs 8y ago

What Programming Languages Have Been Designed to Reduce Naming Things?

vanni
1pts0
www.imaginarycloud.com 8y ago

Brutalist Design Is the Bad Influence We All Need

vanni
335pts163
rust-lang-nursery.github.io 8y ago

Tutorial: Conway's Game of Life in Rust and WebAssembly

vanni
4pts0
uxdesign.cc 8y ago

It's Time for a DevTools for Designers

vanni
163pts85
medium.com 8y ago

String Similarity Algorithms Compared

vanni
1pts0
lwn.net 8y ago

The Programming Talent Myth (2015)

vanni
98pts145
www.kennethreitz.org 8y ago

Requests 3.0 Dev Plan

vanni
1pts0
cakebrowser.com 8y ago

Cake Browser for Android and iOS

vanni
2pts0
medium.com 8y ago

How I Became a Brand

vanni
2pts0
stackoverflow.blog 8y ago

Stack Overflow Gives Back 2017

vanni
2pts0
blog.doist.com 8y ago

A Survival Guide for Parents Who Work Remotely

vanni
2pts0
science.ksc.nasa.gov 8y ago

Personal observations on the reliability of the Shuttle – R. P. Feynman (1986)

vanni
3pts3
meshedinsights.com 8y ago

Oracle Finally Killed Sun

vanni
2pts0

My main concerns as a "technology buyer" are (from what I found online with a rapid search): lack of funding, currently only two main committers (the original author not among them), project apparently in bugfixing-only mode, and the original author online attitude.

Some food for thought (found during a quick evaluation of Svelte for future projects)

Contributors

https://github.com/sveltejs/svelte/graphs/contributors

See main three graphs.

Roadmap

https://github.com/sveltejs/svelte/issues/622

(last comment - Jun 28, 2020) This isn't really an up to date of view on where we are and where we would like to go. We have some tentative plans to improve how we communicate the 'roadmap' in the future. We'll update when we know more.

https://github.com/sveltejs/svelte/issues/3704

Honestly the roadmap for the near future is the same as it's been since Svelte suddenly got much more popular without a corresponding increase in maintainer resources: fixing bugs. Developing exciting new features is going to take a back seat to dealing with the huge backlog of issues for the time being.

From original Svelte author:

https://twitter.com/Rich_Harris/status/1341076126475710465

[...] if you do this on a github repo i'm involved with because you're dissatisfied with the help that was given freely and patiently by other contributors, i will make a mental note of who you are so i can ensure you never get my help, ever

https://twitter.com/Rich_Harris/status/1341167074018795526

[...] believe it or not I don't spend my time waiting around to be summoned by people expecting me to do free work for them

OK, mystery solved. In Python:

  1 in [1,2,3] is True
is evaluated as
  (1 in [1, 2, 3]) and ([1, 2, 3] is True)
similarly to
  1 < 2 < 3
:facepalm:

The disassembly in parent comment is made with CPython 3.6.9, but nothing substantial changes on CPython 3.8.x/3.9.x or PyPy.

Maybe it is related to grammar, and not to compiler...

AST dump in CPython 3.6.9 (manually formatted):

  In [1]: import ast
  
  In [2]: print(ast.dump(ast.parse("""\
     ...: def a():
     ...:     return (1 in [1,2,3] is True)""")))
  
  Module(
      body=[
          FunctionDef(
              name='a',
              args=arguments(args=[], vararg=None, kwonlyargs=[], kw_defaults=[], kwarg=None, defaults=[]),
              body=[
                  Return(
                      value=Compare(
                          left=Num(n=1),
                          ops=[In(), Is()],
                          comparators=[
                              List(elts=[Num(n=1), Num(n=2), Num(n=3)], ctx=Load()),
                              NameConstant(value=True)
                          ]
                      )
                  )
              ],
              decorator_list=[],
              returns=None
          )
      ]
  )
  
  In [3]: print(ast.dump(ast.parse("""\
     ...: def b():
     ...:     return ((1 in [1,2,3]) is True)""")))
  
  Module(
      body=[
          FunctionDef(
              name='b',
              args=arguments(args=[], vararg=None, kwonlyargs=[], kw_defaults=[], kwarg=None, defaults=[]),
              body=[
                  Return(
                      value=Compare(
                          left=Compare(
                              left=Num(n=1),
                              ops=[In()],
                              comparators=[List(elts=[Num(n=1), Num(n=2), Num(n=3)], ctx=Load())]
                          ),
                          ops=[Is()],
                          comparators=[NameConstant(value=True)]
                      )
                  )
              ],
              decorator_list=[],
              returns=None
          )
      ]
  )

It's not a matter of operator precedence for two reasons:

1) "in" and "is" have same precedence, and group left to right (see https://docs.python.org/3/reference/expressions.html#operato...)

2) you'll have runtime error:

  In [1]: def c():
     ...:     return (1 in ([1,2,3] is True))
  
  In [2]: c()
  ...  
  TypeError: argument of type 'bool' is not iterable
It seems related to CPython bytecode compiler implementation, the two functions are parsed in a different way, parentheses make the compiler go on a different path... but I'd like to understand why, without diving into CPython source code :) Anyone?

"pretty unintuitive" is an understatement...

  In [1]: import dis
  
  In [2]: def a():
     ...:     return (1 in [1,2,3] is True)
  
  In [3]: def b():
      ..:     return ((1 in [1,2,3]) is True)
  
  In [4]: a()
  Out[4]: False
  
  In [5]: b()
  Out[5]: True
  
  In [6]: dis.dis(a)
    2           0 LOAD_CONST               1 (1)
                2 LOAD_CONST               1 (1)
                4 LOAD_CONST               2 (2)
                6 LOAD_CONST               3 (3)
                8 BUILD_LIST               3
               10 DUP_TOP
               12 ROT_THREE
               14 COMPARE_OP               6 (in)
               16 JUMP_IF_FALSE_OR_POP    24
               18 LOAD_CONST               4 (True)
               20 COMPARE_OP               8 (is)
               22 RETURN_VALUE
          >>   24 ROT_TWO
               26 POP_TOP
               28 RETURN_VALUE
  
  In [7]: dis.dis(b)
    2           0 LOAD_CONST               1 (1)
                2 LOAD_CONST               5 ((1, 2, 3))
                4 COMPARE_OP               6 (in)
                6 LOAD_CONST               4 (True)
                8 COMPARE_OP               8 (is)
               10 RETURN_VALUE
Why?!

This is called fixed-point arithmetic:

https://en.wikipedia.org/wiki/Fixed-point_arithmetic

In computing, a fixed-point number representation is a real data type for a number that has a fixed number of digits after (and sometimes also before) the radix point.

A value of a fixed-point data type is essentially an integer that is scaled by an implicit specific factor determined by the type.

[dead] 7 years ago

Only six months after we had launched Stack Overflow, my co-founder Jeff Atwood and I were invited to speak at a Microsoft conference for developers in Las Vegas. We were there, I think, to demonstrate that you could use their latest ASP.NET MVC technology on a real website without too much of a disaster. (In fact .NET has been a huge, unmitigated success for us, but you kids go ahead and have fun with whatever platform you want mkay? They’re all great, or, at least, above-average).

A bit too much condescending?

An IP is just an unsigned 32 bit integer:

3520653040 = 209 * 256^3 + 216 * 256^2 + 230 * 256^1 + 240 * 256^0

The 209.216.230.240 representation is the sequence of octets (256 = 2^8) from MSB to LSB expressed as decimal values.