Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
- better byte pretty printing
- remove unused macro
- enable gren optimizations
- remove unused content string from tailwind config
- make message passing description less confusing
  • Loading branch information
ii8 committed Oct 26, 2023
1 parent 84462e0 commit 7e675b9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Lang.gren.in
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def(Parallelism, pe,
Parallel execution paradigm,
TransparentPE, Transparent, Code may be executed in parallel but the semantics of the language are unaffected,
AutomaticPE, Automatic, The programmer can specify the desired parallelism but data sharing between execution threads is handled automatically,
MessagePassingPE, Message Passing, Threads are isolated and communicate only by passing messages through channels,
MessagePassingPE, Message Passing, Threads are isolated and communicate only by exchanging messages,
ControlledSharedStatePE, Safe sharing, Multiple threads can access the same memory but the language semantics ensures that no data races are possible,
ManualSharedStatePE, Shared state, Multiple threads have access to the same memory uninhibited)

Expand Down
14 changes: 9 additions & 5 deletions Main.gren
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,19 @@ rangeToBytes i =
let f = toFloat i in
Math.round (1024 * (2^(f * (17/1000))))

strRound : Float -> String
strRound = String.fromInt << Math.truncate

ppBytes : Int -> String
ppBytes b =
let m = 1024 * 1024 in
if b > 2 * m then
String.fromInt (b // m) ++ "M"
let m = 1024 * 1024
f = toFloat b in
if b > 10 * m then
strRound (f / m) ++ "M"
else if b > m then
String.fromInt (b // m) ++ "." ++ String.left 1 (String.fromInt (b - m)) ++ "M"
strRound (f / m) ++ "." ++ strRound (10 * (f / m - toFloat (b // m))) ++ "M"
else
String.fromInt (b // 1024) ++ "K"
strRound (f / 1024) ++ "K"

range : Int -> String -> String -> Int -> Int -> (Int -> Msg) -> Html Msg
range m title desc min max msg =
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
all: main.js style.css

main.js: Main.gren Lang.gren Bench.gren
gren make Main.gren --output main.js
gren make --optimize Main.gren --output main.js

style.css: Main.gren tailwind.config.js
tailwindcss -o style.css
Expand Down
2 changes: 0 additions & 2 deletions def.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ changequote(«, »)
define(«_nl», «
»)

define(«comma», «,»)

define(«_shift2», «shift(shift($@))»)
define(«_shift3», «shift(shift(shift($@)))»)
define(«_shift4», «shift(shift(shift(shift($@))))»)
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["Main.gren", "Style.gren"],
content: ["Main.gren"],
theme: {
extend: {
boxShadow: {
Expand Down

0 comments on commit 7e675b9

Please sign in to comment.