Meta tags:
Headings (most frequently used words):
to, 2017, and, of, bucklescript, fsil, compiling, type, style, use, gradual, typing, design, javascript, functions, using, records, prefer, sep, jan, modules, up, flash, compiler, new, does, labels, facts, ocaml, archive, ixing, blog, betteridge, nov, optimisation, 21, 2016, law, the, liberated, be, can, idiomatic, change, incremental, from, net, significant, others, architecture, apply, not, ever, headlines, pun, in, msil, avoid, top, inside, everything, put, properties, methods, member, 12, interface, mar, log, console, 11, 2020, 26, consequences, down, fsi, 27, wrap, feb, philosophy, general, modular, intended, apis, oop, interfaces, files, operations, allowed, control, parameters, application, parameter, ml, classic, nana,
Text of the page (most frequently used words):
the (194), and (95), #type (66), #that (55), you (40), #with (35), this (34), #would (34), for (32), #bucklescript (29), let (29), can (29), #javascript (25), #share (22), are (22), but (19), his (19), val (19), #ocaml (19), #name (19), module (17), have (17), off (17), language (16), from (16), they (16), one (15), fsil (15), about (15), person (14), string (14), api (13), like (13), function (12), out (12), datetimeformat (12), all (12), them (12), your (11), get (11), not (11), because (11), style (11), which (11), #modules (11), use (11), types (11), new (11), after (10), may (10), log (10), locales (10), any (10), example (10), december (9), well (9), september (9), bulb (9), november (9), when (9), down (9), values (9), make (9), here (9), some (9), how (9), options (9), runtime (9), operations (9), console (9), family (9), there (9), compiler (9), facebook (8), twitter (8), datetimeformat_make (8), more (8), him (8), just (8), february (8), january (8), try (8), namespace (8), bindings (8), level (8), other (8), code (8), only (8), time (8), parameter (7), its (7), much (7), was (7), pinterest (7), syntax (7), could (7), email (7), files (7), typed (7), comments (7), used (7), myproject (7), blogthis (7), interface (7), using (7), tech (7), intl (7), labels (7), value (6), don (6), want (6), typing (6), design (6), frontend (6), nana (6), october (6), what (6), nice (6), others (6), fun (6), unit (6), now (6), binding (6), compiled (6), 2017 (6), google (6), obj (6), optional (6), functions (6), into (6), async (6), project (6), been (5), backend (5), es5 (5), above (5), existing (5), introduce (5), then (5), simple (5), libraries (5), higher (5), call (5), write (5), control (5), external (5), give (5), argument (5), target (5), through (5), will (5), gradual (5), take (5), exception (5), many (5), while (5), were (5), fsi (5), note (5), msil (5), need (5), terms (5), windows (5), significant (5), work (5), fact (5), constructor (5), world (5), passed (5), compile (5), july (5), int64 (5), those (4), another (4), features (4), hand (4), oop (4), right (4), application (4), data (4), hours (4), parameters (4), gui (4), main (4), away (4), once (4), these (4), semantics (4), single (4), quite (4), think (4), general (4), return (4), records (4), way (4), home (4), gets (4), two (4), especially (4), logic (4), functors (4), better (4), scala (4), advantage (4), also (4), our (4), compiles (4), information (4), books (4), net (4), typeclasses (4), safety (4), easy (4), has (4), cases (4), post (4), back (4), previous (3), attribute (3), points (3), had (3), playground (3), format (3), guarantees (3), decoupling (3), something (3), kept (3), does (3), encoded (3), consolelog (3), classes (3), over (3), order (3), member (3), arguments (3), should (3), prefer (3), idiomatic (3), ffi (3), model (3), functional (3), languages (3), getting (3), array (3), ecosystem (3), means (3), statically (3), npm (3), pure (3), deploy (3), even (3), than (3), state (3), given (3), years (3), worry (3), chess (3), microsoft (3), concrete (3), object (3), around (3), whenever (3), biggest (3), good (3), show (3), understand (3), recently (3), web (3), codebase (3), nothing (3), pass (3), valid (3), problem (3), case (3), april (3), adding (3), put (3), add (3), themselves (3), raise (3), calculator (3), modular (3), march (3), fsharp (3), everything (3), their (3), hide (3), caller (3), every (3), avoid (3), implementation (3), june (3), complex (3), community (3), thinking (3), allow (3), gradually (3), press_number (3), clear (3), turn_off (3), childhood (3), food (3), turn_on (3), apis (3), implement (3), option (3), things (3), top (3), long (3), nodejs (2), packages (2), render (2), specifically (2), generates (2), change (2), forms (2), members (2), list (2), dealing (2), remove_exn (2), with_name (2), package (2), create (2), new_name (2), expose (2), get_exn (2), native (2), though (2), unwrap (2), strings (2), ones (2), helps (2), wrap (2), except (2), obsession (2), methods (2), yourself (2), best (2), maybe (2), inputs (2), edit (2), else (2), warnings (2), exceptions (2), trying (2), default (2), both (2), false (2), end (2), hour12 (2), pun (2), phantom (2), intended (2), left (2), too (2), controlling (2), easily (2), pattern (2), map (2), force (2), together (2), speed (2), reason (2), choice (2), pragmatic (2), record (2), different (2), monads (2), obviously (2), either (2), certain (2), already_off (2), generate (2), feel (2), already_on (2), system (2), sep (2), fantastic (2), app (2), say (2), clr (2), since (2), passes (2), optimisation (2), global (2), typechecker (2), less (2), error (2), parts (2), handling (2), designers (2), future (2), ideally (2), idioms (2), jan (2), simpler (2), intermediate (2), next (2), noisy (2), built (2), usual (2), great (2), static (2), compiling (2), concepts (2), output (2), measure (2), care (2), offer (2), traditional (2), functionality (2), implementing (2), jvm (2), slightly (2), fable (2), flow (2), following (2), bind (2), according (2), basic (2), doesn (2), result (2), going (2), theme (2), actual (2), actually (2), readable (2), safe (2), almost (2), calc (2), plus (2), manual (2), explicitly (2), scenario (2), dynamically (2), abstract (2), press_op (2), writing (2), calculate (2), find (2), takes (2), testable (2), hiding (2), pretty (2), follow (2), little (2), works (2), returns (2), business (2), however (2), approach (2), inside (2), latest (2), still (2), present (2), typescript (2), ceremony (2), mypy (2), number (2), allowed (2), consequences (2), law (2), called (2), lot (2), rounds (2), few (2), house (2), python (2), reader (2), set (2), room (2), filled (2), posts (2), idea (2), side (2), life (2), shelves (2), loved (2), access (2), help (2), large (2), wall (2), spend (2), always (2), place (2), opportunity (2), poetry (2), cassette (2), keep (2), video (2), checking (2), gave (2), 2016 (2), betteridge (2), showed (2), headlines (2), ever (2), apply (2), 2020 (2), today (2), services (2), again (2), morning (2), interest (2), sure (2), got (2), most (2), ends (2), instead (2), game (2), fast (2), domain (2), bring (2), look (2), explore (2), able (2), see (2), august (2), running (2), remember (2), store (2), told (2), mythology (2), powered (2), bangladesh (2), rock (2), header, classic, view, user, depend, complete, part, provide, profile, id_service, crucially, adobe, sum, signatures, simmons, states, express, quick, discriminated, union, 2008, refactoring, ways, enabling, america, 2007, exposing, definitions, lose, 2006, nor, gives, matching, 2009, recommended, benefits, update, angle, immutable, brackets, destructuring, noisier, 2004, mentioned, reverses, postfix, rid, noise, compare, 2005, quickly, yawar, callers, operate, wins, sequences, bypassing, applications, flash, spaces, facts, details, reading, interested, exactly, promise, 2010, generic, west, raised, settled, abstraction, suppose, winforms, form, solution, banking, asian, came, implements, convention, south, suffix, might, statesman, elder, regarded, prepare, _exn, pakistan, chose, extended, formed, fluent, pipeline, based, compound, spacious, dhaka, foundational, five, six, point, migrate, holds, calculation, calculations, press_decimal, double, draws, newly, hooks, event, handlers, highly, invalid_id, 2011, raising, file, turning, archive, blog, nowarn, syntactically, isn, critical, 2015, warning, wrongly, returned, went, wrong, somewhere, 2014, converted, none, 2013, 2012, directive, subscribe, earned, late, respect, prominent, grandfather, father, seq, husband, chowdhury, reiterate, quadir, lutful, unlike, turn, khushwant, closures, interfaces, warns, incomplete, matches, ignore, older, atom, allowable, separately, organisational, fill, anything, enforce, rules, rants, paste, schemas, screenwriting, undefined, security, slashdot, software, sparklines, tell, difference, hence, polymorphic, variants, differentiate, statistics, stats, synchronicity, tex, rather, interact, formatmany, possible, allows, politics, course, implies, intention, retiring, original, popfile, simply, interoperate, safely, ideal, capabilities, card, massively, successful, active, body, usually, mean, annotations, presto, equivalent, leave, tips, formatone, pdf, const, symbol, defined, several, luoman, blogger, fortunately, non, final, really, somehow, overlaying, instance, feature, along, pasting, incremental, character, rambles, stuff, images, marked, required, typography, correct, reference, says, uni, spirit, lazy, working, partly, free, variables, slots, snippet, keyword, xslt, intentionally, guarantee, invalid, merrily, vbscript, fail, usage, virginia, lazily, xml, thanks, demonstrate, opera, blanks, fairly, updated, immutably, replacing, named, fields, eviews, expensr, finance, below, generally, controversial, destructured, similar, wider, genuinely, believe, firefox, read, mar, firewall, flickr, freakonomics, effortlessly, plain, accepts, tool, later, dan, consider, thinker, surprised, expressive, power, economics, eid, excellent, mutating, clarify, somewhat, dedicate, primary, endnote, repetition, refer, prefixed, maximum, clarity, mesh, directly, properties, admittedly, input, consumption, know, mandriva, excel, won, word, misc, whatever, movies, music, start, before, notepad, infer, prints, browser, office, org, adopt, openoffice, communities, maintain, massive, library, ready, practising, malaysia, gmail, strict, installment, chrome, cover, docs, notebook, guns, generated, version, please, handwriting, haskell, wildcard, hobbies, hello, holiday, humour, explorer, internet, internship, latex, binds, linux, mac, bungalow, happy, lush, charmers, yet, manager, makes, securely, flashlights, evening, hairdressers, reasonably, documentation, gardeners, guiding, doors, snake, tappers, tree, indentation, palm, mangling, mapping, various, whichever, fastened, locked, procure, discourage, leaving, webapp, scripts, written, bit, odd, duck, anyone, wise, among, programming, integrates, nuances, accounted, pleasure, program, household, shut, alternative, lookalike, bolted, targets, kind, require, soap, developments, receive, retirement, man, findings, aside, busy, periodically, responsibilities, evaluate, carry, hearing, without, ledger, expenses, decided, failing, recorded, cutlets, background, solid, cuttlefish, accidentally, further, insanely, amd, millisecond, bob, zhang, lead, enjoy, taken, heart, performance, routinely, tries, sought, advice, svn, delays, taste, entire, faster, blink, difficult, friends, slower, whether, visitors, git, clients, querying, quality, load, cycle, saw, finally, year, earlier, emphasise, forced, deal, added, mental, meet, continue, myself, rabbit, holes, available, telling, personally, laziness, purity, driven, people, come, finish, attracted, grateful, overwhelming, feeling, gratitude, knew, zamindari, gift, magi, nov, least, developed, forward, rematch, length, hear, glad, soon, visit, asking, brother, wasted, younger, waiting, agreed, chance, didn, mssql, convincing, integration, ease, reuse, lost, landowning, feasible, leverage, coming, wake, collection, server, wealth, never, performs, core, awake, everyone, binary, making, early, specialised, nightfall, focus, turbulent, balance, sheer, differently, perfect, evergreen, created, contribution, shouldn, missed, persistence, turns, hard, reality, plenty, serve, made, matter, patriarch, mind, maps, very, preserving, important, why, times, high, visited, init, clearly, collector, defining, freed, ties, split, dreams, day, own, bursting, bytecode, existed, rapidly, hasn, gotten, last, major, release, rooms, pop, probably, uncertainty, poring, experiment, fully, balcony, kinded, implicit, evidences, spotless, makers, cream, declaration, easier, ice, arm, dsls, myriad, controls, teach, presents, hipster, evolve, independently, doing, job, knacks, knick, representation, looks, delicate, swiss, composable, cycling, jumping, passing, play, exposed, messy, rendering, embed, personal, window, opposite, soccer, garages, calculatorapp, driveway, zero, nine, giant, lawn, minus, sqrt, green, cricket, badminton, situation, watch, outside, pour, team, affect, common, liberated, architecture, feb, rain, tea, philosophy, gather, shutters, storm, seasons, monsoon, activity, monopoly, board, conclude, aim, carrom, parameterised, examples, names, absorbed, algebra, lifts, burden, having, awakened, compatibility, rest, sponge, ixing, lend, separate, squarely, child, small, singh, henry, focused, lower, maugham, outputs, somerset, hands, powerful, worrying, thought, dev, treat, layer, paying, attention, exact, seeing, advances, brings, art, rental, calculus, trips, advantages, decoupled, essays, history, toolchain, possibly, places, process, greek, processor, thing, encoding, step, concerned, encode, currently, rule, fit, found, slide, entertained, preserve, instances, units, recorder, etc, sets, basis, specific, distributed, users, link, against, signs, math, subject, possibilities, stages, organisation, backends, entranced, spring, become, someone, bed, erlang, beam, opened, pride, each, doubt, near, erased, storage, defunctorised, displayed, instantiations, survive, normal, proudly, optimise,
Text of the page (random words):
also let you hide data definitions and give your caller abstract types to work with enabling information hiding and decoupling quick example person fsi namespace myproject module person type t val make string t val id t int64 val name t string val with_name string t t person fs namespace myproject module person type t id int64 name string let make name id id_service get name name let id id i i let name name n n let with_name new_name t t with name new_name in the above example we hide the person t type s implementation details so that callers can t create values of the type themselves bypassing our api nor can they operate on values of the type in any way except the ones we provide as part of the person module also we take advantage of the above mentioned f destructuring pattern matching and immutable record update benefits we don t get from oop style to quickly access and change exactly the parts of the data we re interested in use classic ml style type parameter application the recommended style of type parameter application in net is with angle brackets after the type constructor but this is noisy and just gets noisier as your types get more complex use ml style which reverses the order of application to postfix but gets rid of most of the noise let s compare type a1 async option person t type a2 person t option async type b1 choice string person t type b2 string person t choice type c1 a map string a type a c2 string a map ml style type application gives you the biggest wins for sequences of single parameter applications but it still spaces out the code in general which helps with reading use type parameters to control allowed operations when your type has operations that are only valid when the type is in a certain state then you can express it as a discriminated union a sum type so that operations work in different ways for different cases of the du but the problem with exposing the cases of a du is that you lose decoupling you can t easily control future refactoring of the type because user code will depend on existing du cases another problem is maybe certain operations don t work for all states of a type let s try an example namespace myproject module bulb type t on off exception already_on exception already_off let turn_on function off on on raise already_on let turn_off function on off off raise already_off both of our critical operations on the bulb t type are raising exceptions if called wrongly sure we could have returned a none bulb t option instead if something went wrong but that just passes the checking to the caller somewhere else there is a better way phantom types here s the above example converted bulb fsi namespace myproject module bulb type on type off type a t val on on t val off off t val turn_on off t on t val turn_off on t off t bulb fs namespace myproject module bulb type on interface end type off interface end phantom type left hand type parameter isn t used on right hand type a t on off let on on let off off compile warnings are ok here because we re controlling allowed inputs let turn_on off on let turn_off on off note that the compiler warns us here about incomplete pattern matches on the bulb t type but we ignore them in this case because we re explicitly controlling allowable function inputs at the type level we can turn off this warning with a nowarn 25 compiler directive in the bulb fs file but in general turning off warnings is not a good idea prefer records of functions to interfaces here is a good write up about this but let me reiterate interface methods can t be easily passed around unlike record member functions which can be closures remember an example api fs namespace myproject module api exception invalid_id type a t get_exn int64 a async add a unit async remove_exn int64 unit async list unit a seq async person fs namespace myproject module person type t id int64 name string let make id name id id name name let id id i i let name name n n val api t api t let api get_exn fun id add fun person remove_exn fun id list fun above we implement a generic data store api and a domain type that implements the api note that as a convention we add an _exn suffix to code which might raise an exception this helps the reader prepare to reason about exception handling wrap oop style apis in modular f when dealing with traditional oop style apis e g windows forms try to wrap them up in modular f and expose only the f abstraction e g suppose you re writing a simple gui calculator app in winforms you need to 1 write out the logic and make it testable and 2 render the gui in a form solution put these things in a module calculator fsi namespace calculatorapp module calculator type number zero one two nine type op plus minus sqrt type t val init t we will implement these operations as mutating to allow a more fluent pipeline based api like let result calc clear press_number five press_op plus press_number six calculate at this point calc is in the state that it holds a calculation result we can clear it to do more calculations val clear t t val press_number number t t val press_op op t t val press_decimal t t val calculate t double draws the app and hooks up event handlers to the above operations val render t system windows forms control now in the implementation follow the types to implement the business logic and the gui note how the logic is testable because the main operations are exposed but the messy oop gui rendering is not the caller just gets back a control to embed in their main window this is composable and readable general philosophy to conclude we aim for these design points information hiding with interface files simpler less noisy syntax is better modular is better ideally everything is in a module logic encoded in the types is better you get compile time guarantees and have to do less runtime error handling at 03 16 no comments email this blogthis share to twitter share to facebook share to pinterest labels fsharp tech feb 27 2017 can f be liberated from the net architecture recently i ve been thinking about the delicate situation that the f language designers find themselves in whenever they want to introduce new features especially semantics into the language or whenever the c team want to introduce features that may affect that language or the common language runtime the problem has clearly existed for a while f hasn t gotten any significant new features since its last major release the latest example to pop up is probably the uncertainty over adding typeclasses especially now that it looks like c is thinking about adding them too so how can f be freed from its ties to c and the net runtime well one way would be to split the f compiler into two parts the frontend that compiles f code to its own intermediate language let s call it f intermediate language or fsil and the backend that compiles fsil to some other target language like msil or javascript like fable jvm bytecode native compiling f to fsil this presents the main advantage that the f language can evolve independently of c and the clr the compiler frontend need only worry about doing a great job of implementing f syntax and semantics in terms of a single target representation that it controls fully the language can rapidly experiment with new syntax and semantics or in fact with the traditional ml language family semantics just by defining a general fsil to target some examples of this would be implementing typeclasses or ml style parameterised modules functors or scala style implicit evidences or an easy to use call by name function parameter declaration syntax for easier control flow dsls or higher kinded types or any of a myriad of things all you have to do is teach the frontend to understand your new syntax and compile it to fsil the nice thing about fsil is that it would preserve nice concepts like units of measure typeclasses ml modules and functors etc because it was specifically built to understand them f modules would be compiled down to fsil files on a one to one basis and f specific libraries could be distributed as fsil packages users could link against them to get the nice higher level functionality that msil doesn t offer compiling fsil to msil and others this step would be concerned with the best way to encode fsil in terms of the target language or runtime e g currently f modules are encoded as static msil classes this is obviously a great fit and others may be found for higher level f features but no doubt some fsil functionality would be erased e g functors would be defunctorised and compiled away to nothing any concrete instantiations of functors would survive as normal modules encoded as static classes as usual or typeclasses would be compiled down to pass instances in explicitly in the msil encoding with this organisation other backends could spring up fable could become a backend from fsil to es5 6 someone could write a backend for fsil to jvm or the erlang runtime beam or the ocaml runtime there are quite a few possibilities opened up by decoupling the two ends from each other optimisation with fsil we would have the opportunity to do separate optimisation passes on the higher level typed f focused fsil and on the lower level clr or other target outputs we would be able to take advantage of the information that we would have at those points in the process while not worrying about the previous or following stages f ixing up there are many advantages to a decoupled frontend backend design for the f toolchain possibly the biggest one is that it places f s future as a powerful language squarely in the hands of the f language designers and lifts from them the burden of having to worry about compatibility with the rest of net at 00 28 no comments email this blogthis share to twitter share to facebook share to pinterest labels fsharp tech jan 21 2017 bucklescript a significant new ocaml to javascript compiler recently i ve been paying attention to the bucklescript compiler from ocaml to javascript es5 to be exact i m seeing some significant advances that it brings to the state of the art and thought i would share a little background i use scala js at work and it is rock solid once you re set up with a project you are pretty much good to go bindings to significant js libraries are high quality i use some of the biggest names in js frontend dev libraries today and all in a nice scala style object functional layer that aside i still periodically look around the ecosystem and try to evaluate the latest developments i ve been hearing about bucklescript for a while but only recently decided to try it out for a side project after trying and failing to understand how this works in javascript so without further ceremony let me present my findings bucklescript s compiler is insanely fast because bob zhang the project lead has taken to heart the ocaml obsession with performance and routinely tries to optimise away millisecond level delays once you get a taste of that speed entire project compiled faster than you can blink you ll find it difficult to go back to something slower it s like getting to use git after you ve used svn all your life it compiles to idiomatic readable es5 with nice indentation almost no name mangling and a one to one mapping from ocaml modules to es modules whichever kind you prefer require amd google it targets and integrates with the existing npm ecosystem it doesn t try to introduce yet another package manager it makes writing bindings types for existing js libraries reasonably easy and the documentation the manual especially is fantastic at guiding you through that ocaml is a bit of an odd duck syntax wise even among the functional programming languages there are nuances to get used to but once you get used to them it is a pleasure to program in and if you just can t get used to them you can always try out facebook s reason which is an alternative javascript lookalike syntax for ocaml this focus on integration and ease of reuse of the javascript ecosystem means it s feasible to leverage the npm package collection in your pure ocaml project you can deploy a backend server which performs core functions as a statically compiled native binary i e not nodejs deploy es5 nodejs services which take advantage of specialised npm packages for mssql querying or soap clients or what have you and you can deploy es5 in your frontend webapp scripts all written in pure ocaml so why ocaml specifically after all there are plenty of nice languages out there as it turns out that ocaml obsession with speed and type safety together serve it well here it s a pragmatic simple and matter of fact language and its runtime model maps very well to the javascript runtime model while also preserving important compile time safety guarantees i should emphasise that it s pragmatic you re not forced to deal with the added mental load of monads and other type system rabbit holes but they re all available if you need them personally i feel that laziness purity and monads have driven away more people than they ve attracted i think that ocaml gets the balance right others obviously feel differently but in concrete terms bucklescript is a significant contribution that shouldn t be missed if you ve developed in a compiled language for any length of time and like type safety guarantees after trying bucklescript you ll be asking yourself how much time you ve wasted over the years waiting for your compiler to finish so you can continue your edit compile cycle maybe it s best not to think too much about that at 15 29 no comments email this blogthis share to twitter share to facebook share to pinterest labels bucklescript javascript ocaml tech nov 4 2016 nana nana is what i called him but to the world he is the late lutful quadir chowdhury a well loved husband father grandfather prominent in the respect he earned from his large extended family and a highly regarded elder statesman of the south asian banking community for a time he settled down and raised his family in then west pakistan but when the time came he chose to migrate to the newly formed bangladesh my nana was a foundational rock of my childhood in dhaka to me his spacious home compound with its large bungalow lush green back lawn and giant driveway with two garages at opposite ends were my personal domain to explore and play in i have many happy hours of running jumping cycling cricket soccer badminton carrom board monopoly and every other childhood activity there i remember monsoon seasons when we would bring the storm shutters down and the family would gather for tea and watch the rain pour down outside through the wall to wall balcony windows hours and hours of poring through his rooms and shelves filled to bursting with books to this day i have dreams that are set in that house nana was a collector of knick knacks that any hipster today would give his right arm for hand powered ice cream makers spotless swiss food processor sets a video cassette recorder that h...
|