metaclass: (Default)
metaclass ([personal profile] metaclass) wrote2016-02-21 03:42 pm

Статья про хаскель в проде, где все правильно написано

http://www.stephendiehl.com/posts/production.html

Про типичную опердень и как она умучает рантайм хаскеля:

A common performance problem is that of many small updates updates to records with large numbers of fields. Records of hundreds of fields are somewhat pathological but in practice they show up in a lot of business logic that needs to interact with large database rows. Too much of this can very noticeable impact on GC pressure by doing allocations on each update.

По ходу, рекорды у них лежат плоскими в памяти и каждый раз при апдейте их надо клонировать. Наверно, заменить их на мапы и прочие словари с деревом в кишках реализации будет проще, не говоря уже о невменяемости рекордов в хаскеле в целом.

И про метапрограммирование: Avoid TemplateHaskell. Half the appeal of Haskell is that its high-level design allows you to avoid huge amounts of useless boilerplate code that you have to write in other languages. If you need compile-time code generation, you’re basically saying that either your language or your application design has failed you.

Как без метапрограммирования нормально делать опердени, где 99% кода - это бойлерплейт по перекладыванию между полями разных объектов и БД - хрен его знает.
Всякие ORM с рефлекшенами и кодогенерацией в рантайме - это то же самое, только медленно и уныло.

[identity profile] love5an.livejournal.com 2016-02-23 06:20 am (UTC)(link)
Да я всю сознательную жизнь говорю, что хаскель и иже с ними, это извращение для шизофреников, которые и опердени то не писали.

Покажите хоть одну опердень на хаскеле! Нет ведь. Одни сраные хелловорлды, с заострением внимания на какой-то бесполезной малозначимой хероте(типа, смотрите как у нас круто фунцыю map писать!). Ни одной практической проблемы, ни одного практического решения, за все время наблюдени за хаскель-коммьюнити я не увидел. Самое близкое, что видел, это, что даже не смешно - GLR-парсеры. GLR-парсеры, Карл. Блеать.

[identity profile] thesz.livejournal.com 2016-02-26 02:28 pm (UTC)(link)
Сюда надо позвать [livejournal.com profile] dmzlj и [livejournal.com profile] zelych.

[identity profile] thesz.livejournal.com 2016-02-26 02:37 pm (UTC)(link)
А!

И ещё привести пример Amgen: https://ifl2014.github.io/submissions/ifl2014_submission_16.pdf

"The success or failure in the industry of a programming language within a particular problem domain is often predicated upon the availability of a sufficiently plethoric set of good quality libraries relevant to the domain. Libraries enable code reuse, which ultimately leads to shorter development cycles. Yet business and regulatory constraints may impose orthogonal requirements that not allprogramming languages are able to satisfy.

Case in point: at Amgen, we operate within a stringent regulatory environment that requires us to establish high confidence as to the correctness of the software that we create. In life sciences, it is crucial that we aggressively minimize the risk that any bug in our code, which could lead to numerical, logical or modelling errors with tragic consequences, goes undetected."

А вот причина, по которой Amgen вообще связался с Хаскелем: http://thesz.livejournal.com/1432089.html Треть медицинских исследований содержит ошибки в логике обработки результатов. Наличие типов позволяет запретить сравнивать p-значения, например. Или получать p-значение для результата сравнения.

[identity profile] dmzlj.livejournal.com 2016-02-26 06:39 pm (UTC)(link)
Ну мы очередную опердень запустили пару недель назад, например. Туроператора. Не знаю, где ты там наблюдаешь, алсо, то же самое я мог бы говорить про скобки, кложу или скалу. Ну или про сиплюсплюс.