Better HN
topnewbestaskshowjobs
Log inSign up

xtrapolate

529 karma · joined Jan 2, 2018 (8y ago) · 142 submissions

Submissions

comment 8y ago · link · parent

> "Is there a geographical bias in your skepticism? Would you be as skeptical if this kid was from Norway or Sweden or Austria?"

Nothing in the parent comment implies a so-called "geographical bias", yet there you are accusing them of being racist.

comment 8y ago · link · parent

> "Davidson sued, arguing that he was owed royalties for unauthorized use of an image of his statue"

Orthogonal, though can't help but wonder whether Davidson got Frédéric Auguste Bartholdi's approval before re-creating an almost identical statue.

comment 8y ago · link · parent

Not refuting your theory, but in all probability, you (like most others in the industry) have friends ("friends"?) that simply relay info to recruiters from these two companies. Poaching is often done that way.

Also, at least in my case, both Google and Facebook periodically reach out, years after our last formal interaction.

Had a recruiter working for one of my clients for a few years. They later left the company and joined the competition. Recruiter's past "success stories" all got contacted, not a week after.

comment 8y ago · link · parent

So, which came first to the bay area? the engineers, or the companies? Are we at a point where most people move in to the bay area for work? Or is it the other way around (ie. companies wanting to establish a foothold in an area known for its prestigious/unique population of software-engineers)?

My point is, not only are the employees losing here, but also the employers. I no longer understand the motivation of companies to continue expanding at problematic locations (such as the bay area and new-york).

If Google left the bay area completely tomorrow, would that somehow restore the equilibrium?

comment 8y ago · link · parent

Are you seriously suggesting this is an issue? That's entirely up to you to solve in your custom allocator.

Use whatever mechanism is available to you. Use a global condition variable, check it atomically every time you're entering your custom allocator, increment after a successful allocation. I don't know your system's constraints, nor should I...

comment 8y ago · link · parent

  void * your_custom_allocator(size_t size)
  {
      // Handle your locks.
      // Sanity checks, assertions, bounds checks, etc...

      void * result = g_your_buffer + g_position;

      // "Commit Memory" from your buffer.
      g_position += size;

      // Some more code...

      return result;
  }
Now, you can happily use:

  BASE64DECODE_DecodeEx(..., your_custom_allocator, your_custom_deallocator);
What else do you need? You seem very disturbed by the use of the word "allocator" here, feel free to rename to whatever works for you.

comment 8y ago · link · parent

> "You're imagining a world where everything is Node or Python or Java, or at the worst C on top of the well-defined standard library. And I'm telling you that the world is bigger than that."

Why do you keep putting words in my mouth?

> "But what if I don't have a heap? Not even a wrappable heap."

I'm forced to repeat myself over again. At no point does my proposed API force you to rely on a heap. On the contrary, it lets you rely on whatever solution works best for you, in your specific case.

In your custom kernel project, your custom allocator() can return a buffer from a memory pool you handle yourself. Your custom deallocator() will reclaim that memory back into your custom memory pool.

In a different project, say a desktop app for Windows 10, the allocator() will simply call malloc(), and the deallocator() will call free().

This way, your allocator() can do whatever. Your deallocator() can do whatever. How is this restrictive in any way shape or form?

comment 8y ago · link · parent

> "Pollution is in the eye of the beholder. There are many circumstances where a project or subset of a project needs to work without a heap, they just don't necessarily overlap with the "application layer code in a virtual memory process" world your intuition is calibrated against."

That's an argument in favor of offloading allocation/deallocation to the library's users, which is exactly the core of my, and OP's, proposals. We're saying the same thing here - developers should be able to determine/control how memory is allocated and deallocated.

> "And sometimes this stuff needs to read a JSON object or decode base64 or utf8 too, and can't because the library is too thick."

I'm losing you here. I honestly feel that my proposal is all about keeping the API as simple as humanely possible, without compromising the library's flexibility when it comes to the scenarios your mentioned earlier.

In your case:

  BASE64DECODER_Decode(...)
  BASE64DECODER_DecodeEx(..., allocator, deallocator)
  BYTE * BASE64DECODER_GetDecodedBuffer(handle)
  BASE64DECODER_Free(handle)

comment 8y ago · link · parent

> "The library mustn’t call malloc() internally. It’s up to the caller to allocate memory for the library. What’s nice about this is that it’s completely up to the application exactly how memory is allocated. Maybe it’s using a custom allocator, or it’s not linked against the standard library."

OP's approach will indeed work for most "minimalist"/single-header libraries, but, I personally feel it pollutes the API you're exposing to your users.

Depending on the specific situation, I may sometimes choose to expose a MODULE_CreateObject() and a MODULE_CreateObjectEx(custom_allocator, custom_deallocator).

Internally, MODULE_CreateObject() calls MODULE_CreateObjectEx(), passing the module's default allocators and deallocators (ie. HeapAlloc and HeapFree). This strikes me as a more balanced approach.

One caveat here, is that you must enforce consistency across usage - you don't want some API calls to use malloc() for allocation, whilst others use HeapFree() for deallocation, that would be a recipe for disaster.

To ensure that, I would often set the allocators and deallocators once, when the object is first created. They may be set through the object's initialization function, and they persist as part of the object itself.

comment 8y ago · link · parent

> "Yes, PHP and Node.JS and Ruby all are just as bad or worse than Python. That's the whole point!"

The original comment I was replying to was taking a stab at Python in particular. All I'm saying, is that in the open-source community, in that specific regard, Python doesn't stand out. Many developers care about backwards compatibility, many (dare I say, most) others simply don't.

I've had a large Java repo that broke recently, after we've updated some of our Maven deps to slightly newer versions (that was a very large, well known and used package). So those things happen in the "Java world" too.

comment 8y ago · link · parent

I can recommend Snyk[0] (I am not affiliated, have used their products with clients before). They've got a fully functional free tier, and they have a ton of relevant features. And yes, there are other, competing products out there you could use.

[0] https://snyk.io/docs/snyk-for-python

comment 8y ago · link · parent

> "Considering C++ or Rust."

You've mentioned many issues you've had with your Python code base. Would you kindly expand on how/why C++ or Rust solve those in your particular case?

comment 8y ago · link · parent

> "you cannot afford to spawn the interpeter on each request"

You mention this as a case against using Python, but this is entirely unrelated to Python as a framework. In other words, had they used PHP or Node or %s, they'd still have to face the issue of optimizing the request-to-response path.

This relates much more to the issues that often come with the common practice of separating your webserver, from your business logic (Flask, in our case).

> "so you have to use some asynchronous tooling"

Solutions such as mod_cgi and wsgi have been the standard for years at this point. That's, in many ways, a solved problem.

> "In order to get off the ground, you also need to use pip, which causes an inordinate number of problems vs. the bsd ports tree or .deb files."

Any specific issues you can expand on? Because this is a rather vague form of criticism.

Using pip is ridiculously easy. I've been using Python extensively in various production environments and rarely had to point a finger at pip. Package and dependency management in Python are solid (that isn't to say things can't improve).

> "You can use virtual environments for each script, but then patching zero days becomes infeasible."

Again, this is an entirely subjective form of criticism. I haven't had any issues with keeping my virtualenvs up to date.

> "If you want basic type safety, you need to rely on external tooling."

Again, you just seem to favor strongly typed languages and that's fine, but that's hardly a point against using Python here. Type safety is simply not a Python thing, much like weak typing is not a C thing.

> "In my experience, third party python libraries evolve types and api’s without warning. This shows up at runtime, so it introduces security holes."

Developers will sometimes break APIs. How is this a Python-specific issue? These things are literally happening everywhere.

comment 8y ago · link · parent

https://rada.re/r/cmp.html

Radare, in my opinion, is mostly lacking on the user-experience sides. IDA is easier to pick-up and use. Also, I feel Radare's decompilers don't fare as-well as Hex-Rays. I equate this to Windbg - your best Windows debugger, which unfortunately is relatively tough to pick up (I'd argue, mostly due to poor UI choices). Forgoing that, Radare is absolutely packing.

I've moved on to reverse most of my projects with Radare. I'm still missing a handful of small features/plugins from IDA, but it's not a big issue.

comment 8y ago · link · parent

Honest question. You keep expecting all of these to be readily available for you in C (as part of the standard). Why don't you, instead, just a use a language/ecosystem which already offers all (or most) of these for you today? (ie. D/Go/Rust/Nim)

> "* Reference counted allocator (basically, get libtalloc and roll it in [1])"

Why and how should that be standardised exactly? Memory allocation is platform-dependent, hardware-dependent and generally case-specific. malloc() and free() are the lowest common denominators the standard can assume, anything beyond that is simply restrictive. If you need a "reference counted allocator", why not just find/implement one that simply suits your needs?

> "* Coroutine standardisation would be awesome (stack swap primitives, with boundary checks etc)...."

Again, what makes you think this can be standardised across the infinite span of platforms and compilation-targets, where C is often used?

> "* In fact I want SIMD. I don't need these complex types."

I'm not following your point. You're simply asking for a better abstraction for SIMD. Also, as I'm sure you're well aware, SIMD is not available everywhere. Wherever available, you have clear instruction-set APIs/ABIs you need to follow to make it work. What else is missing?

comment 8y ago · link · parent

It doesn't really matter which hash function they use here... Your common MAC-48 address is a [Manufacturer ID (3 bytes), Device ID (3 bytes)], this further reduces the enumeration requirements...

comment 8y ago · link · parent

What happens when a GDPR claim is dismissed by a court? Are the plaintiffs required to compensate the defendants? Can Facebook/Google counter-sue for damages?

What's stopping anyone from randomly filing GDPR claims against every other website? How many such claims can the system handle at any given time before succumbing to years-long queues?

comment 8y ago · link · parent

> "hope they dont have a wealth of new source IP's to spawn their attacks from"

You'd still be able to detect new addresses and block as necessary. I don't see your point, of course the solution proposed isn't entirely hermetic, but how does your suggestion overcome this exact issue?

> "This kind of approach only works if you are happy to pay the bandwidth price"

Precisely the reason why most people would rather opt-out of serving malicious requests.

comment 8y ago · link · parent

None of these options will solve your issues. Your attackers will simply re-adjust the mechanism as soon as they figure out your heuristics. You'll need to focus on two efforts:

(1) Being able to identify the IPs from which attacks originate, in real time. You will need to blacklist those hosts (for a limited period of time).

(2) Minimizing and limiting the impact of traffic you previously flagged, on your infrastructure. Ideally, as hostile traffic is flagged, a response is never sent (at the TCP/UDP level). You absolutely do not want to serve any flagged requests. Block traffic as early as possible.

comment 8y ago · link · parent

Do I have to state the obvious? This is an open source effort. Not all attempts at persuasion bear fruit. If you feel you are being ignored (by what would appear is a group of maintainers you absolutely despise), I guess the other option would be to fork the repo. This would not be the first time in history people split code over disagreements.

comment 8y ago · link · parent

> "instead of fixing what it has and being standards compliant, it chooses to break away and do its own thing along with the new bugs and other issues which will surely arise."

Well, people are still free to maintain and improve those older tools and bring them up to par with newer standards, if they want to.

Others would argue it's time to start phasing out code and so-called "standards" we've had since the early 90s in spirit of refactoring various elements in the ecosystem. As with most such efforts - lots of code will be thrown away, some of it will be re-used and re-purposed. I'd argue that in the long run - it's probably a necessary intervention.

comment 8y ago · link · parent

> "Old does not mean bad"

It doesn't automatically mean "good" either.

> "in its pursuit to be Windows"

Would you please elaborate?

comment 8y ago · link · parent

> "Typically these are brittle C/C++ programs, with lots of state and branching logic, and further they become extremely hard to refactor because their function is so integral to running the facility"

Switching to Erlang won't inherently make those issues disappear. Erlang could definitely save you some C/C++ boilerplate code, but if your business logic is still stateful, it's not necessarily going to be easier to implement any of that with Erlang.

Erlang is probably more forgiving on the developers than C/C++ are, but that can be said of many other languages (ie. Python, Java).

If you're looking to pass messages around between processes/threads, there are plenty of libraries you can use today to start refactoring that C/C++ code:

http://nanomsg.org/

http://zeromq.org/

https://www.rabbitmq.com/ (most likely an overkill for the specific use-case you described, will be more relevant in a distributed computing scenario)

comment 8y ago · link · parent

> "Your argument is that there is no case law so you get to claim whatever imaginary consequence you want."

No, that's not my argument at-all. That's just your personal interpretation of my words.

> "You’re also claiming people are rightfully concerned."

I'm not "also claiming". That was the sole claim from the very start.

> "Where is that right coming from? From past experience? Or is they just baseless concerns?"

It's literally in the comment:

(1) Some elements of the GDPR are up for interpretation.

(2) There's currently no case law surrounding GDPR.

If you take both of these facts into account - it is perfectly plausible for people to be concerned, as there's no telling how things will play out in a court of law.

comment 8y ago · link · parent

> "I guess we should only enact new laws which already have established case law. /s"

I disagree with the author's lenient and dismissive take on people's genuine concerns. Interpret it as you will.

comment 8y ago · link · parent

Stop spamming every single comment on this thread. Your question is irrelevant and misdirected - I've literally started my argument by saying that "there's currently no case law surrounding GDPR".

comment 8y ago · link · parent

There's currently no case law surrounding GDPR. Moreover, some elements of the GDPR are up for interpretation. People are rightfully concerned.

> "This post is an attempt to calm the nerves of those that feel that the(ir) world is about to come to an end"

This post is actually a single person's viewpoint, a mere speculation of how things may or may not turn out to be. Your mileage may vary.

12345