By Jason – October 13, 2011
At
Cloudmetrx, we use a lot of C. So given the recent passing of UNIX
legend Dennis Ritchie, the creator of the C language, we think a toast
to C is only fitting.
Our extensive reliance on C is especially
unusual considering the other languages in our stack – Clojure, Node.js,
and other hipster platforms. We aren't predisposed to using older,
"venerated" technologies simply because they're older and venerated. But
when it comes to high-performant computation, there's just nothing like
C. Some will claim Java, but those people are incorrect. There's
nothing like C.
In my opinion, the reason C has maintained its
popularity for all these years is that it is relatively paradigm-free.
Most languages, for better or worse, come equipped with some inherently
recommended programming paradigm – object-oriented, functional,
whatever. The realities of the hardware, then, are sculpted to best
support that paradigm.
C, on the other hand, doesn't sculpt the
hardware. It gives you raw access to the hardware. You do what you wish
with the hardware. There is no inherent overhead due to your paradigm –
you are expected to enforce whatever paradigm you please by yourself.
C
is the Turing part of the Church-Turing Thesis. C basically gives you
math plus a ticker tape you can write onto. All algorithms revolve
around those two basic concepts: reading and writing to the tape, and
doing small mathematical operations.
As it happens, the universal
computing device referred to in the Thesis is implemented like Turing,
but often used like Church. The lambda calculus revolves around
meaningful and elegant representations of behavior, as it makes sense to
humans; but the Turing Machine represents behavior as it makes sense
for a machine based on transistors and electrons. It is the more natural
of the two; and so C is a more natural way to harness the power of the
actual hardware, at the expense of readability, and perhaps even
elegance.
It is quite a feat to create a technology still being
actively used decades after its inception and rise to popularity. I
don't think the only reason is that it is (relatively speaking)
paradigm-free. The syntax itself is also brilliant – as complex as the
language is, and as complex as managing memory is, C makes it
brilliantly clear what is going on. The C syntax has also influenced
other languages – from PERL to Java to JavaScript – a testament to its
clarity and usability.
And with all this power, C is still a joy
to write in. There's something special to me about cracking a 5-hour
energy and sitting down with vim
to hack some C. It's like
driving a manual car, and feeling the rush as you switch gears, going
faster and faster. After a month of Python, C drives like a BMW with a
rocket engine. The speed is facemelting; you run time
and your jaw drops at the results – a millisecond! For that? Amazing.
But C isn't always pretty. C can be a naughty girl that seg faults, leaving you in despair, confused, forced to use gdb
. But at the end of the day, you always come back to C – that seductress of speed. [Citation needed]
At Cloudmetrx, we use C for essentially all of our financial logic except bootstrapping
.
Without the ability to crank out a blindingly fast result in C, the
Real-Time Cloudmetrx product would likely be impossible, since we
wouldn't be able to use horizontal scale to handle the loads. And
indeed, the speed difference between a derivative pricing model – many
of which require Monte Carlo – written in C and a model written in Java
is noticeable. Not huge, but noticeable; and likely too big to serve
real-time financial analytics.
So here's to C, that naughty girl, that seductress of speed. Salud!
From: http://jasonvictordartmouth.posterous.com/a-toast-to-c
分享到:
相关推荐
在XCode的项目导航器中,右键单击“ Libraries ➜ Add Files to [your project's name] 转到node_modules @merryjs/toast并添加MerryToast.xcodeproj 在XCode的项目导航器中,选择您的项目。 将libMerryToast.a...
产品在测试过程中发现一个bug,就是测试人员不停的疯狂的点击某个按钮,触发了toast以后,toast内容会一直排着队的显示出来,...可是在测试的过程中,发现却没有想象中的那么简单,不信可以百度一下,很多很多人发现to
即使Toast-to-front应用程序与下图所示的先前显示的应用程序无关,Toast也将保留在屏幕上: 您可以很容易地注意到,Toasts的问题在于它们是持久的。 吐司被解雇后,它会显示在任何屏幕的顶部,并且在创建时所指定的...
Cooking some toast notifications b. Raw notifications c. Your app on the lockscreen 8. Make your app adaptable: Windows 8 will appear on a variety of devices with different aspect ratios, ...
RubyOnWheels Toast模块,允许您使用Ruby进行编码!..." # Prints to Toast's logger motor = Toast :: Motor . new :talon , :can , 1 # Creates a new Talon on the CAN Bus with ID 1 motor . set 0.4 # Set
小行星警报 这是一个使用JavaScript构建的... $toast("Deleted", "#E74C3C"); }) $alert("Successfull", '#E74C3C') $toast("No internet connection", "#F4D03F") $loader_show("#FF5733") If you don't pr
imageResId = new int[] { R.drawable.a, R.drawable.b, R.drawable.c, R.drawable.d, R.drawable.e }; titles = new String[imageResId.length]; titles[0] = "第一个"; titles[1] = "第二个"; titles...
If the baseView is nil, the toast will be added to a new window over the screen. maker.baseView = nil; // The toast view. It could be a text toast(HWTextToastView) 、 a loading toast...
很好的实验项目:通知、LED、异步任务、振动、服务、权限、共享首选项、对话框、xml 资源中定义的数组、Toast、广播接收器等。 配色方案三元组基于#ff4000 #0A67A3(蓝色)、#70E500(绿色)、#A62A00(栗色) 一些...
ToastUtils Toast Unility Class UrlUtils Url Unility Class VibratorUtils Vibrator Unility Class ViewUtils View Unility Class Permission Proguard -keep class com.wx.android.common.** { *; ...
EditText搜索结果下拉框、自动or回调模式、可diy、使用超简便 (EditText search results drop-down box, auto or callback mode, diy, easy to use) Github地址 YangsBryant/BSearchEdit (Github排版比较好,建议...
整理文档,搜刮出一个android 通过MediaRecorder实现简单的录音示例,稍微整理精简一下做下分享。 MainActivity ... import android.media.MediaRecorder; import android.os.Environment;...import android.widget.Toas
如果能看到 connected to <device-ip-address>:5555 这样的输出则表示连接成功。 节注一: 有的设备,比如小米 5S + MIUI 8.0 + Android 6.0.1 MXB48T,可能在第 5 步之前需要重启 adbd 服务,在设备的终端模拟器...