Hacker Newsnew | past | comments | ask | show | jobs | submit | 8a's commentslogin

Can you expand on this?

Also, what do you prefer over Python?


Python and perl are very very similar. Python prioritises expressiveness over uniformity, perl is the opposite. Perl's original OO mechanism was stolen from pythons, but due to the greater flexibility it means that there's a lot of choice and perl's extended OO capabilities exceed that of python. Personally I hate the way that the python people keep bagging out perl when it's clear they know little about it.

I don't have preferences as such. My main problem is that over the past few years my perl skills have been in such high demand that I haven't had much time to do substantial other programming stuff (this is a class of problem you want to have). I have been playing with python's maths libraries (particularly sympy) lately, and along with jupyter it's pretty neat stuff.


umm uniformity over expressiveness


What changed?

On what basis where applications reviewed before?

What do you mean here by rolling basis?


What I've never seen discussions on signal safety address is: why must an OS have signals to begin with?


This (signal) is the de-facto communication mechanism to notify a program that an unexpected event just occurred (typically, a SEGV). This mechanism needs to interrupt the normal program flow (because you can not restart an invalid access most of the time), possibly interrupting a C-library call (such as malloc, reason why malloc is not async-signal-safe generally). What would you do instead ? On Windows systems, there is a built-in "__try / __except" mechanism ("structured exception handling", SEH), which provides exception-like catch in plain C with proprietary extension to C. This is probably not such a better method.


> This is probably not such a better method.

It actually really, really is. At least from a technical perspective on x64. Having language-level lexical scoping of system-level exceptions is incredibly useful and once you've grokked how NT's trap handler, PE .xdata sections, prologues and epilogues all work in concert, signals just seem barbaric.

Here's an example trapping an access violation:

    //
    // Prefault the page.
    //

    TRY_MAPPED_MEMORY_OP {
        TraceStore->Rtl->PrefaultPages(PrefaultMemoryMap->NextAddress, 1);
    } CATCH_EXCEPTION_ACCESS_VIOLATION {

        //
        // This will happen if servicing the prefault off-core has taken longer
        // for the originating core (the one that submitted the prefault work)
        // to consume the entire memory map, then *another* memory map, which
        // will retire the memory map backing this prefault address, which
        // results in the address being invalidated, which results in an access
        // violation when we try and read/prefault it from the thread pool.
        //

        TraceStore->Stats->AccessViolationsEncounteredDuringAsyncPrefault++;
    }
Or an alignment fault:

    FORCEINLINE
    VOID
    StoreXmm(
        _In_ XMMWORD *Destination,
        _In_ XMMWORD  Source
        )
    {
        TRY_SSE42_ALIGNED {
    
            _mm_store_si128(Destination, Source);
    
        } CATCH_EXCEPTION_ACCESS_VIOLATION {
    
            _mm_storeu_si128(Destination, Source);
        }
    }
Or an illegal instruction:

    FORCEINLINE
    VOID
    StoreYmmFallbackXmm(
        _In_ PYMMWORD Destination,
        _In_ PXMMWORD Destination128Low,
        _In_ PXMMWORD Destination128High,
        _In_ YMMWORD  Source,
        _In_ XMMWORD  Source128Low,
        _In_ XMMWORD  Source128High
        )
    {
        TRY_AVX {
    
            TRY_AVX_ALIGNED {
    
                _mm256_store_si256(Destination, Source);
    
            } CATCH_EXCEPTION_ILLEGAL_INSTRUCTION {
    
                Store2Xmm(
                    Destination128Low,
                    Destination128High,
                    Source128Low,
                    Source128High
                );
    
            }
    
        } CATCH_EXCEPTION_ACCESS_VIOLATION {
    
            _mm256_storeu_si256(Destination, Source);
        }
Or a page fault that has occurred against a memory map backed file (because, say, the underlying network drive has been disconnected):

    TRY_MAPPED_MEMORY_OP {

        //
        // Copy the caller's address range structure over.
        //

        __movsq((PDWORD64)NewAddressRange,
                (PDWORD64)AddressRange,
                sizeof(*NewAddressRange) >> 3);

        //
        // If there's an existing address range set, update its ValidTo
        // timestamp.
        //

        if (TraceStore->AddressRange) {
            TraceStore->AddressRange->Timestamp.ValidTo.QuadPart = (
                Timestamp.QuadPart
            );
        }

        //
        // Update the trace store's address range pointer.
        //

        TraceStore->AddressRange = NewAddressRange;

    } CATCH_STATUS_IN_PAGE_ERROR {

        //
        // We'll leak the address range we just allocated here, but a copy
        // failure is indicative of much bigger issues (drive full, network
        // map disappearing) than leaking ~32 bytes, so we don't attempt to
        // roll back the allocation.
        //

        return FALSE;
    }
Relevant macro definitions:

    #define TRY_AVX __try
    #define TRY_AVX_ALIGNED __try
    #define TRY_AVX_UNALIGNED __try
    
    #define TRY_SSE42 __try
    #define TRY_SSE42_ALIGNED __try
    #define TRY_SSE42_UNALIGNED __try
    
    #define TRY_MAPPED_MEMORY_OP __try
    
    #define CATCH_EXCEPTION_ILLEGAL_INSTRUCTION __except(     \
        GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION ? \
            EXCEPTION_EXECUTE_HANDLER :                       \
            EXCEPTION_CONTINUE_SEARCH                         \
        )
    
    #define CATCH_EXCEPTION_ACCESS_VIOLATION __except(     \
        GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? \
            EXCEPTION_EXECUTE_HANDLER :                    \
            EXCEPTION_CONTINUE_SEARCH                      \
        )
    
    #define CATCH_STATUS_IN_PAGE_ERROR __except(     \
        GetExceptionCode() == STATUS_IN_PAGE_ERROR ? \
            EXCEPTION_EXECUTE_HANDLER :              \
            EXCEPTION_CONTINUE_SEARCH                \
        )


Writing in the morning.


How easy is it to get feedback? How quickly do you see results?


Can you expand a little bit on your question? I'll answer the best I understand your question.

Being in industry with a large firm, feedback is very simple to get, I just go give a talk at an internal seminar.

Results of a model or an implementation? Repeated observations/out of sample analysis often help with validating models. Implementation depends on the project.


Sure. I was trying to understand how hard it is for economists to make progress fast. I would imagine an economic model takes months to years to validate. I'm used to getting instant feedback from a computer when writing a program.

Do you see the way economic models are built and tested improving or happening faster? Or is the main barrier not lack of diverse data points, but needing enough time to pass to stress the model.


This is an important data point surveys like this ignore.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: